mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-03 14:50:48 -06:00
* PSD: read and write vibA, blnc, blwh, phfl, mixr adjustment layers Vibrance, Color Balance, Black & White, Photo Filter and Channel Mixer layers made in PhotoCraft were dropped on PSD save (Photoshop saw an empty pixel layer), and the same blocks rendered as no-ops on import. They are now parsed into their Adjustment variants and written per the Adobe spec (descriptor blocks with version 16; phfl version 2/3; mixr version 1). A Color Lookup without a table is written as an identity cube and a Gradient Map with fewer than two stops as the equivalent two-stop gradient, so every evaluated kind has an encoding. Tests: golden hand-built blocks for each new key, malformed and fuzzed input, and a document -> PSD -> document round trip of every adjustment kind (8 and 16 bit, plain / masked + blended / clipped) and every blend mode (pixel, clipped, group, pass-through, adjustment layers), asserting model equality where lossless and composite equality within 1/255. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Corpus: export round-trip step and pass floors; fill pixels in the mask frame corpus.rs now re-imports every exported file and compares its flatten with the first import (169/169 render the same). With PHOTOCRAFT_CORPUS set (corpus dir, or 1 for the default location) it asserts the oracle pass floor (113) and the round-trip floor (169). The new step found gradient fills without Photoshop pixels exported in the canvas frame instead of the frame their masks give them, so they re-imported shifted (gradient-fill.psd/.psb, 0.26 max error). Export now renders the fill like the compositor (render_fill_content). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>