From 0fb31eb63df6dd3997c61cb0aedc751f28346cfe Mon Sep 17 00:00:00 2001 From: yoriswind Date: Sun, 1 Nov 2026 14:04:20 -0800 Subject: [PATCH] docs: document supported direct adjustment forms and limits --- docs/atn.md | 151 +++++++++++++++++++------------------ docs/development.md | 11 +++ docs/file-format-parity.md | 3 +- 3 files changed, 92 insertions(+), 73 deletions(-) diff --git a/docs/atn.md b/docs/atn.md index 61c2403a19..9b87f2e3df 100644 --- a/docs/atn.md +++ b/docs/atn.md @@ -18,7 +18,7 @@ layers and documents, newer and older events and files, and a measured reference map yet, with everything needed to implement them without the reference application. -## Supported events (117) +## Supported events (119) | Code | String ID | Label | PhotoCraft command(s) | |---|---|---|---| @@ -76,6 +76,8 @@ the reference application. | `Flip` | flip | Flip | `image.imageRotation.flipCanvasHorizontal`, `image.imageRotation.flipCanvasVertical`, `edit.transform.flipHorizontal`, `edit.transform.flipVertical` | | `GsnB` | gaussianBlur | Gaussian Blur | `filter.blur.gaussianBlur` | | `GdMp` | gradientMapEvent | Gradient Map | `image.adjustments.gradientMap` | +| `GrMp` | (code only) | Gradient Map (recorded classic form) | `image.adjustments.gradientMap` | +| `RplC` | replaceColor | Replace Color (Lab sample box) | `image.adjustments.replaceColor` | | `Grow` | grow | Grow | `select.grow` | | `Hd ` | hide | Hide | `layer.hideLayers` | | `HghP` | highPass | High Pass | `filter.other.highPass` | @@ -140,6 +142,81 @@ the reference application. | (string ID only) | updatePlacedLayer | Update Smart Objects | `layer.smartObjects.updateModifiedContent` | | `Vbrn` | vibrance | Vibrance | `image.adjustments.vibrance` | +### Supported direct adjustment settings + +#### Gradient Map (direct) + +- Event: `GrMp` (no string ID) +- PhotoCraft command: `image.adjustments.gradientMap` +- Supported: classic (`Gcls`, also when omitted), 2..64 ordered custom RGB stops at midpoint 50, smoothness 4096, and the two opaque endpoint transparency stops. Fractional RGB components retain their precision and the recorded name and event survive save. +- Other interpolation methods, midpoints, transparency, unsorted stops and unsupported descriptor forms remain kept steps. This does not change the separate legacy `GdMp` event mapping. + +| Key | String ID | Type | Unit | Default | Allowed | +|---|---|---|---|---|---| +| `` | gradientsInterpolationMethod | enumerated | | gradientInterpolationMethodType.'Gcls' classic | | +| `Grad` | gradient | object | | obj 'Grdn' gradientClassEvent | | + +Nested values as recorded (defaults): +``` + 'Nm ' name : STRINGTYPE = "Vorder- zu Hintergrundfarbe" + 'GrdF' gradientForm : ENUMERATEDTYPE = 'GrdF' gradientForm.'CstS' customStops + 'Intr' interfaceIconFrameDimmed : DOUBLETYPE = 4096 + 'Clrs' colors : LISTTYPE = list[2] + [0] OBJECTTYPE = obj 'Clrt' colorStop + 'Clr ' color : OBJECTTYPE = obj 'RGBC' RGBColor + 'Rd ' red : DOUBLETYPE = 0 + 'Grn ' green : DOUBLETYPE = 0 + 'Bl ' blue : DOUBLETYPE = 0 + 'Type' type : ENUMERATEDTYPE = 'Clry' colorStopType.'UsrS' userStop + 'Lctn' location : INTEGERTYPE = 0 + 'Mdpn' midpoint : INTEGERTYPE = 50 + [1] OBJECTTYPE = obj 'Clrt' colorStop + 'Clr ' color : OBJECTTYPE = obj 'RGBC' RGBColor + 'Rd ' red : DOUBLETYPE = 255 + 'Grn ' green : DOUBLETYPE = 255 + 'Bl ' blue : DOUBLETYPE = 255 + 'Type' type : ENUMERATEDTYPE = 'Clry' colorStopType.'UsrS' userStop + 'Lctn' location : INTEGERTYPE = 4096 + 'Mdpn' midpoint : INTEGERTYPE = 50 + 'Trns' transparency : LISTTYPE = list[2] + [0] OBJECTTYPE = obj 'TrnS' transferSpec + 'Opct' opacity : UNITDOUBLE = 100 '#Prc' percentUnit + 'Lctn' location : INTEGERTYPE = 0 + 'Mdpn' midpoint : INTEGERTYPE = 50 + [1] OBJECTTYPE = obj 'TrnS' transferSpec + 'Opct' opacity : UNITDOUBLE = 100 '#Prc' percentUnit + 'Lctn' location : INTEGERTYPE = 4096 + 'Mdpn' midpoint : INTEGERTYPE = 50 +``` + +#### Replace Color + +- Event: `RplC` / `replaceColor` +- PhotoCraft command: `image.adjustments.replaceColor` +- Supported: the explicit D50 Lab minimum/maximum box and `colorModel` 0, with the four integer settings clamped to the ranges below. Matching uses original pixel channels through the document profile. Unsupported color models, malformed or missing samples and unknown keys remain kept steps. +- Measured with example values in a prepared document: the Value column shows what was sent and recorded, not a factory default (a step always carries the values the user set). + +| Key | String ID | Type | Unit | Example value | Allowed | +|---|---|---|---|---|---| +| `Fzns` | fuzziness | integer | | 40 | 0 .. 200 (out-of-range values are clamped) | +| `Mnm ` | minimum | object | | obj 'LbCl' labColor | | +| `Mxm ` | maximum | object | | obj 'LbCl' labColor | | +| `H ` | hue | integer | | 30 | -180 .. 180 (out-of-range values are clamped) | +| `Strt` | saturation | integer | | 0 | -100 .. 100 (out-of-range values are clamped) | +| `Lght` | lightness | integer | | 0 | -100 .. 100 (out-of-range values are clamped) | +| `` | colorModel | integer | | 0 | | + +Nested values as recorded (example values): +``` + 'Lmnc' luminance : DOUBLETYPE = 40 + 'A ' a : DOUBLETYPE = 30 + 'B ' b : DOUBLETYPE = 40 + 'Lmnc' luminance : DOUBLETYPE = 40 + 'A ' a : DOUBLETYPE = 30 + 'B ' b : DOUBLETYPE = 40 +``` + + ## Known gaps in mapped events A mapped event can still lose a setting. Every mapped event was checked on 2026-11-01: the 5 296 steps of @@ -1419,7 +1496,7 @@ No parameters: the step carries an empty descriptor. ### Group E: Video, Other and matting filters and the direct Gradient Map / Replace Color adjustments -All commands exist in PhotoCraft; only the `.atn` mapping is missing. Gradient Map and Replace Color here are the direct adjustments (Image > Adjustments), not adjustment layers (those are already mapped). +All commands exist in PhotoCraft. The two direct adjustments, classic Gradient Map and Lab-range Replace Color, are supported above; the remaining events below still need their `.atn` mappings. These direct adjustments are separate from adjustment layers. #### De-Interlace @@ -1462,50 +1539,6 @@ No parameters: the step carries an empty descriptor. No parameters: the step carries an empty descriptor. -#### Gradient Map (direct) - -- Event: `GrMp` (no string ID) -- PhotoCraft command: `image.adjustments.gradientMap` -- The `gradient` object is the same gradient form the adjustment layer already maps; reuse that code. - -| Key | String ID | Type | Unit | Default | Allowed | -|---|---|---|---|---|---| -| `` | gradientsInterpolationMethod | enumerated | | gradientInterpolationMethodType.'Gcls' classic | | -| `Grad` | gradient | object | | obj 'Grdn' gradientClassEvent | | - -Nested values as recorded (defaults): -``` - 'Nm ' name : STRINGTYPE = "Vorder- zu Hintergrundfarbe" - 'GrdF' gradientForm : ENUMERATEDTYPE = 'GrdF' gradientForm.'CstS' customStops - 'Intr' interfaceIconFrameDimmed : DOUBLETYPE = 4096 - 'Clrs' colors : LISTTYPE = list[2] - [0] OBJECTTYPE = obj 'Clrt' colorStop - 'Clr ' color : OBJECTTYPE = obj 'RGBC' RGBColor - 'Rd ' red : DOUBLETYPE = 0 - 'Grn ' green : DOUBLETYPE = 0 - 'Bl ' blue : DOUBLETYPE = 0 - 'Type' type : ENUMERATEDTYPE = 'Clry' colorStopType.'UsrS' userStop - 'Lctn' location : INTEGERTYPE = 0 - 'Mdpn' midpoint : INTEGERTYPE = 50 - [1] OBJECTTYPE = obj 'Clrt' colorStop - 'Clr ' color : OBJECTTYPE = obj 'RGBC' RGBColor - 'Rd ' red : DOUBLETYPE = 255 - 'Grn ' green : DOUBLETYPE = 255 - 'Bl ' blue : DOUBLETYPE = 255 - 'Type' type : ENUMERATEDTYPE = 'Clry' colorStopType.'UsrS' userStop - 'Lctn' location : INTEGERTYPE = 4096 - 'Mdpn' midpoint : INTEGERTYPE = 50 - 'Trns' transparency : LISTTYPE = list[2] - [0] OBJECTTYPE = obj 'TrnS' transferSpec - 'Opct' opacity : UNITDOUBLE = 100 '#Prc' percentUnit - 'Lctn' location : INTEGERTYPE = 0 - 'Mdpn' midpoint : INTEGERTYPE = 50 - [1] OBJECTTYPE = obj 'TrnS' transferSpec - 'Opct' opacity : UNITDOUBLE = 100 '#Prc' percentUnit - 'Lctn' location : INTEGERTYPE = 4096 - 'Mdpn' midpoint : INTEGERTYPE = 50 -``` - #### Average - Event: `Avrg` (no string ID) @@ -1526,32 +1559,6 @@ No parameters: the step carries an empty descriptor. | `Ofst` | offset | integer | | 0 | -9999 .. 9999 (measured in the dialog). Without the dialog the value is ignored | | `Mtrx` | matrix | list | | none: a step always carries all 25 cells | exactly 25 integers (5 x 5, row by row), each -999 .. 999; a 3 x 3 list makes the application fail | -#### Replace Color - -- Event: `RplC` / `replaceColor` -- PhotoCraft command: `image.adjustments.replaceColor` -- Measured with example values in a prepared document: the Value column shows what was sent and recorded, not a factory default (a step always carries the values the user set). - -| Key | String ID | Type | Unit | Example value | Allowed | -|---|---|---|---|---|---| -| `Fzns` | fuzziness | integer | | 40 | 0 .. 200 (out-of-range values are clamped) | -| `Mnm ` | minimum | object | | obj 'LbCl' labColor | | -| `Mxm ` | maximum | object | | obj 'LbCl' labColor | | -| `H ` | hue | integer | | 30 | -180 .. 180 (out-of-range values are clamped) | -| `Strt` | saturation | integer | | 0 | -100 .. 100 (out-of-range values are clamped) | -| `Lght` | lightness | integer | | 0 | -100 .. 100 (out-of-range values are clamped) | -| `` | colorModel | integer | | 0 | | - -Nested values as recorded (example values): -``` - 'Lmnc' luminance : DOUBLETYPE = 40 - 'A ' a : DOUBLETYPE = 30 - 'B ' b : DOUBLETYPE = 40 - 'Lmnc' luminance : DOUBLETYPE = 40 - 'A ' a : DOUBLETYPE = 30 - 'B ' b : DOUBLETYPE = 40 -``` - ### Group F: Selection combinations, Paste Into/Outside, Fade, Link, Distribute, Define Pattern and older merge/mask events Steps recorded in an ordinary editing session. The values below were measured in a document set up for each step (a selection, the clipboard, linked or several selected layers). Align, Copy/Paste Layer Style and Rename are already mapped under their current events and are not repeated here. diff --git a/docs/development.md b/docs/development.md index 3ecefb9f59..ce77192078 100644 --- a/docs/development.md +++ b/docs/development.md @@ -631,6 +631,17 @@ PhotoCraft equivalent. Events outside the table load as `actions.photoshopStep` steps that keep the descriptor verbatim (so Save Actions writes them back) and fail at playback with the step's Photoshop name. + +Recorded direct Gradient Map (`GrMp`) and Replace Color (`RplC`) forms are described in +[the ATN reference](atn.md#supported-direct-adjustment-settings), based on davidmann4's +measurements in #10603. Gradient Map keeps its event, fractional RGB stops and recorded name; +unsupported interpolation, midpoint and transparency settings remain preserved steps. +Replace Color accepts `labMinimum` / `labMaximum` (three D50 Lab numbers each), exclusively +of RGB samples and localized settings. The new option matches native surface samples through +the document profile, retains alpha and untouched native pixels, and uses one undoable edit. +A zero tone shift validates its inputs without changing pixels. The existing RGB option keeps +its previous behavior. Explicit Lab bounds require a composite pixel-layer target. + ## Remove Tool quality `cargo run --release -p photocraft-engine --example remove_quality -- [out dir]` fills diff --git a/docs/file-format-parity.md b/docs/file-format-parity.md index 1fc994a94e..bbe68a5daf 100644 --- a/docs/file-format-parity.md +++ b/docs/file-format-parity.md @@ -133,7 +133,7 @@ remaining gaps in #1606 stay tracked with per-sample corpus ceilings. | LUTs `.cube` / `.3dl` / `.look` | R/W (Export Color Lookup) | R/W / R / R | `cms/src/lutfile.rs` | | Keyboard shortcuts `.kys` | R/W | R/W | `engine/src/kys.rs` (`write`: Edit › Keyboard Shortcuts › Export…, rows carry our id; Photoshop reading our files is unverified) | | ICC profiles | R | R | Own CMS | -| Actions `.atn` ([reference](atn.md)) | R/W | R/W | `psd/src/atn.rs` (version 16 sets, exact round trip), `engine/src/atn_cmds.rs` (Photoshop events ↔ commands, including Apply Layer Comp by name, #7101; other steps kept verbatim; Save As maps to `file.saveAs`/`file.saveACopy` when its destination is a file, #7102). Panel menu, CLI `batch --actions set.atn`, `actions.load`/`actions.save`. Photoshop 5-era version 12 files unsupported (AUTO-219-2) | +| Actions `.atn` ([reference](atn.md)) | R/W | R/W | `psd/src/atn.rs` (version 16 sets, exact round trip), `engine/src/atn_cmds.rs` (Photoshop events ↔ commands, including Apply Layer Comp by name, #7101; recorded classic `GrMp` with fractional RGB stops and `RplC` with explicit Lab sample bounds, part of #10607; other steps kept verbatim; Save As maps to `file.saveAs`/`file.saveACopy` when its destination is a file, #7102). Panel menu, CLI `batch --actions set.atn`, `actions.load`/`actions.save`. Photoshop 5-era version 12 files unsupported (AUTO-219-2) | | Styles `.asl` | R/W | R/W | `psd/src/asl.rs`, `io/src/asl_map.rs`; Styles panel Import/Export Styles…, `style.presets.importAsl`/`exportAsl` (#1051) | | Contours `.shc` | R/W | R/W | `psd/src/shc.rs`; Contour Editor Load…/Save… (FILE-215-15). No user contour library; not yet checked against a Photoshop-written file | | Custom shapes `.csh`, tool presets `.tpl` | R/W | no | | @@ -148,6 +148,7 @@ Embedded SVG and PDF-compatible AI/PDF/EPS payloads can use an explicit VectorCr | Date | Change | Summary | |---|---|---| +| 2026-11-01 | minor | Recorded direct Gradient Map and Lab-range Replace Color load, play and retain their measured settings on save; unsupported forms remain preserved (part of #10607). | | 2026-11-01 | minor | `.atn`: event reference [atn.md](atn.md): the 117 supported events, and measured keys, defaults, ranges and enum values for 101 events not mapped yet | | 2026-10-26 | minor | Embedded AI/PDF/EPS save-back retains native format and a separate source-bound display preview; original sources remain undoable. Native Adobe interoperability and standalone EPS/DCS remain unverified; no corpus floor or percentage changed. | | 2026-10-22 | minor | Embedded PSD vectors gain explicit bounded SVG editor/save-back; standalone EPS/DCS and native-format fidelity remain open. |