Commit Graph
3891 Commits
Author SHA1 Message Date
Hector VillarrealandClaude Opus 5.5 ce6b88c12b Actions: refuse a Trap step wider than Photoshop takes (CodeRabbit review on crates/engine/src/cmd/atn_cmds/steps_channels.rs:67)
`image.trap` accepts any width, and `trap_to` wrote it straight to
`Wdth`, so a step above the 32767 px the import clamps to saved a value
Photoshop doesn't take. Like other out-of-range exports (fields.rs,
#7287), it now refuses the step rather than clamping it to another width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:51:37 -06:00
Hector VillarrealandClaude Opus 5.5 86f7359bfd Actions: keep a wrong-typed De-Interlace, HSB/HSL or Custom step (CodeRabbit review on crates/engine/src/cmd/atn_cmds/steps_other.rs:53)
A present enumeration key of another type, or a Custom `Scl `/`Ofst`
that isn't a number, was read as missing and played with Photoshop's
default. A `setting` helper (as in steps_image.rs) now reads a present
key with its expected type and returns None otherwise, so the step stays
a Photoshop step. It also reads `Scl` without its padding, which the key
gate already admitted but the mapper read as the default 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:47:25 -06:00
Hector VillarrealandClaude Opus 5.5 5a4bd379d0 Actions: map all 47 Filter Gallery effects (#10592)
Filter Gallery steps (GEfc with the effect in GEfk, or the effect's own
event) map every effect to filter.gallery.<effect>, not only Spatter:
each key in recorded order, out-of-range values clamped and missing
keys given Photoshop's defaults, enumerations, Invert and Neon Glow's
colour mapped both ways. The table is generated from the event
reference's Group A; every integer range and default matches the
effects'. Glass maps the Frosted and Canvas textures the reference
gives codes for. A setting the event cannot hold refuses the step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:44:27 -06:00
yoriswind 815f5bdad0 Preserve measured Trace levels through playback and save 2026-10-31 20:41:15 -07:00
Hector VillarrealandClaude Opus 5.5 4a6883eede Actions: map Photoshop's Video, Other, Average and matting steps (#10607)
De-Interlace (Dntr), NTSC Colors (NTSC), HSB/HSL (HsbP), Custom (Cstm),
Average (Avrg) and Remove Black / White Matte (RmvB/RmvW) load as their
commands, play, and save back with the same keys. Missing keys take
Photoshop's defaults; a Custom matrix that is not 5 x 5 keeps the
Photoshop step. Replace Color and the direct Gradient Map (GrMp) are
still kept verbatim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:29:26 -06:00
Hector VillarrealandClaude Opus 5.5 1eb8f7d4da Actions: keep a wrong-typed Smart Sharpen step, read an unpadded Rds (CodeRabbit review on crates/engine/src/cmd/atn_cmds/steps_image.rs:575)
The enum and Boolean gates passed a present key of another type, and
the amount and radius fell back to their defaults. The key gate admits
`Rds` without its padding, but the radius was read as `Rds ` only, so it
played as 1. Every key now goes through `setting`, which reads the key
as the gate admits it and keeps a wrong-typed step as a Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:24:40 -06:00
Hector VillarrealandClaude Opus 5.5 7525fde387 Actions: keep an Oil Paint step with a wrong-typed setting (CodeRabbit review on crates/engine/src/cmd/atn_cmds/steps_image.rs:527)
A present lightingOn or numeric key of another type passed the key-name
gate, read as missing and played with Photoshop's default. Each key now
goes through `setting`, so such a step stays a Photoshop step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:23:44 -06:00
Hector VillarrealandClaude Opus 5.5 292f48d0cf Actions: keep a Select Sky step whose sampleAllLayers isn't a Boolean (CodeRabbit review on crates/engine/src/cmd/atn_cmds/steps_image.rs:486)
A wrong-typed sampleAllLayers was read as missing and the step played
with false. A shared `setting` helper now reads a present key with its
expected type and returns None otherwise, so the step stays a Photoshop
step, like settings the command can't represent.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:22:46 -06:00
yoriswind b4a066e34e Cover changed ATN settings and Fade opacity boundaries 2026-10-31 20:15:50 -07:00
Hector VillarrealandClaude Opus 5.5 36c90925e9 Actions: map Photoshop's channel and colour steps (#10609)
Split Channels (SplC), Merge Spot Channel (MSpt), Trap (Trap) and Match
Color without a source (matchColor, noReference) load as channel.split,
channel.mergeSpot, image.trap and image.adjustments.matchColor and save
back with the keys Photoshop records. The split's recorded documentIDs
belong to its run and are neither replayed nor written; Trap's width is
clamped to 32767 px; Match Color takes Photoshop's defaults. Steps the
events cannot carry (a split keeping its original, a named spot
channel, a Match Color source or option) are refused on export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:15:26 -06:00
yoriswind 1f8ea3b61a Keep Trace Contour levels outside native support unchanged 2026-10-31 20:13:23 -07:00
Hector VillarrealandClaude Opus 5.5 a03120e8b4 Actions: map Photoshop's Distort filter steps (#10605)
Pinch, Polar Coordinates, Spherize, Twirl, Wave and ZigZag steps load
as filter.distort.*, play, and save back with every key in recorded
order. Out-of-range values are clamped as Photoshop clamps them and
missing keys take Photoshop's defaults (Wave's undefined areas are
Repeat Edge Pixels). A Wave scaled below 100 % stays a Photoshop step,
as the command has no scale. Shear is still kept verbatim: its curve
points need a step recorded through its dialog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 21:04:42 -06:00
yoriswind 0c508e558f Use a supported assertion in the selection fixture test 2026-10-31 20:03:50 -07:00
yoriswind ec44d1711f Map ATN selection and layer-operation events 2026-10-31 19:59:52 -07:00
yoriswind 34ba5d0122 Preserve duplicate Render descriptor keys and correct ATN docs 2026-10-31 19:56:58 -07:00
Hector VillarrealandClaude Opus 5.5 1d22ffc1ff Actions: map Photoshop's newer-feature steps (#10610)
Oil Paint (oilPaint), Smart Sharpen (smartSharpen), Focus Area
(focusMask), Select Sky (selectSky) and Remove Background
(removeBackground), recorded by string ID, load as their commands and
save back with the keys and defaults Photoshop records. Oil Paint's and
Select Sky's Photoshop defaults are written out where they differ from
the commands'. Smart Sharpen maps the legacy Lens Blur form with no
noise reduction; other forms stay Photoshop steps. Settings the events
cannot carry refuse the step on export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 20:51:05 -06:00
yoriswind 25b7ac59f3 Reject channel selections that cannot round-trip through ATN 2026-10-31 19:34:25 -07:00
yoriswind 7246b53ac3 Complete Render action descriptors and playback checks 2026-10-31 19:19:45 -07:00
yoriswind 8d47e4efef Complete measured Stylize and Pixelate ATN mappings 2026-10-31 19:12:01 -07:00
yoriswind ab80116d32 Start Render action mappings with Clouds events 2026-10-31 19:03:42 -07:00
yoriswind 7906cd8bc2 Start Stylize and Pixelate ATN adapters with parameterless events 2026-10-31 18:58:08 -07:00
yoriswind d7a2a3362e Import native color component selections from Photoshop actions 2026-10-31 18:56:53 -07:00
yoriswind 822e72d856 Guard named Batch playback against recursion and budget bypass 2026-10-31 18:53:45 -07:00
yoriswind 4580778ce2 Document Batch and droplet action selection 2026-10-31 18:21:54 -07:00
yoriswind 9033499c05 fix: honor selected actions in Batch and Create Droplet 2026-10-31 18:11:22 -07:00
Hector VillarrealandClaude Opus 5.5 be7d681673 Free Transform: lift a pixel's coverage up to all of it, as Move does
Transforming a selection split each pixel as a·k and a·(1 − k), so a
selection loaded from the layer's own transparency (⌘-click) left a
faint ghost of its anti-aliased edge behind. Move already lifts up to the
pixel's coverage (min(a, k), leaving max(a − k, 0)); split_selected now
does the same, for Free Transform, its live preview, Warp and Distort.
An opaque pixel still splits as k and 1 − k.

Fixes #5595

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 14:23:25 -06:00
aiongg 799e129628 Merge pull request #10145 from davidmann4/integration-batch-10
Integration batch: 18 PRs on main
2026-10-31 13:31:44 -04:00
Khawar Zamman Wani f3caa319a2 Keep brush state intact when preset tip loading fails (#10288) 2026-10-31 13:07:18 -04:00
David MannandClaude Opus 5.5 e46be131e9 Merge #9274's current head (7da275ea6) into the batch
The author's main merge brings one new test (full coverage keeps Threshold over
extreme float channels) and rewords the #9483 tone comment; its main side
(b1cfff9d3) is already in the batch. Docs keep the batch's newer status lines and
revision rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 14:43:14 +01:00
David MannandClaude Opus 5.5 622707a36f Address CodeRabbit review: four findings on the batch
- Channel targeting routes an allow-list of pixel-editing paint commands, not every
  `paint.*` id: the Mixer Brush's Alt-click load and Symmetry no longer follow a colour
  set or get refused with "Rasterize the layer" on a fill layer. Patch and Content-Aware
  Move stay routed (#9274).
- Native vector save-back checks the preview SVG as strictly as stored previews are
  checked on load and PSD export, so a preview with an unreadable embedded image is
  refused instead of stored and later dropped (#8571).
- .pcraft blobs read their zstd frame with framing headroom, so an incompressible
  preview right at its 16 MiB limit still loads; the limit still bounds the data.
- Levels/Curves recall (Alt+shortcut) decides the combined Lab record from the target
  the dialog captured, as remembering does, so a viewed layer mask keeps its settings
  beside a Lab colour set (#9274).

Each comes with a test that fails without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 14:41:36 +01:00
David MannandClaude Opus 5.5 4ca14ee527 Type: copied type brings the styles it uses, scaled with it (#10500)
The reference application, measured with Duplicate Layer from 72 to 300
ppi: a character or paragraph style the destination lacks arrives under
its name with its sizes scaled like the text (24 pt -> 5.76 pt), so the
copy has no override; a destination style of the same name keeps its
definition and the copy shows an override (+).

Copies never brought styles before: a copied run kept the source's style
id, which in the destination named another style or none. Copy to
Document, Paste and Duplicate Layer > New Document now match styles by
name, add the missing ones under fresh ids and point the runs at them;
retarget_type_resolution scales the point values of the styles that
travel with the copies.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 14:36:42 +01:00
Lcoding15 dce32b66d8 engine: Free Transform takes soft edges whole after a move (#10461)
After moving selected pixels, the selection is the moved pixels' alpha
(#7538, measured in Photoshop). Free Transform split the layer by
multiplying the selection into each pixel, so a soft edge pixel of
alpha a was lifted as a² and a × (1 − a) of it stayed behind: a grey
outline of the shape at its old place.

`split_selected` now lifts the selection's share of each pixel's
coverage, up to all of it, as moving selected pixels already does
(`float_cmds::cut_piece`, #7655). Opaque pixels still split as k and
1 − k, and fully selected pixels move whole, as before. Warp, Distort
and the live transform preview share the function.
2026-10-31 14:05:02 +01:00
Hector VillarrealandClaude Opus 5.5 c69ad0e86c Actions: recording into an existing set keeps its exact name (CodeRabbit follow-up on actions_cmds.rs:373-378)
Test: record_keeps_an_existing_sets_exact_name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 03:42:23 -06:00
Hector VillarrealandClaude Opus 5.5 02af2370b1 Actions panel: New Set makes an empty set, and New Action records into the selected set (#7535)
Photoshop's Actions panel has a folder button and a New Set… menu item that make an
empty action set (default "Set 1"); New Action lands in the selected set. PhotoCraft
showed sets from Load Actions but couldn't make one.

- actions.newSet: an empty set (default "Set N"), kept for the session until it
  holds an action; actions.record takes a `set` for the new action.
- Actions panel: the folder button and New Set… open a name dialog; empty sets show
  as folder rows; a click on a folder row selects it; New Action records into the
  selected action's set, else the selected set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 02:08:22 -06:00
Hector VillarrealandClaude Opus 5.5 e57d9d1cbe ATN export: Stroke steps write the settings they leave at default (#8303)
Photoshop opens the Stroke dialog for a Stroke descriptor without its blend
mode, even with dialogs off, so an exported action stopped there. stroke_to
now writes edit.stroke's defaults for location (center), opacity (100),
mode (Normal) and preserveTransparency (false) when the step leaves them out,
as Photoshop's own recorded Stroke carries them all.

Fixes #8303

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 22:58:26 -06:00
marshiyar da1b2e0070 fix(engine): refuse strict .atn export of a partial Levels edit (#8530)
layer.setAdjustment changes only the settings it names, but the Levels
descriptor writes each range whole and fills the end an edit did not name
with 0 or 255. A recorded {"kind":"levels","inBlack":31} was exported as
Inpt [31, 255] with nothing skipped, so replaying it also reset a retained
Input White. This is the Levels half of #8701 (Color Balance and
Hue/Saturation, #8531).

levels_complete accepts a Levels edit only when, for the master curve and
every channel object, inBlack/inWhite are both given or both absent, and
likewise outBlack/outWhite. set_to uses it as the levels arm of the
existing completeness check, so strict export refuses the step and a
non-strict export lists it as skipped.

Test partial_levels_edits_refuse_strict_export fails without the fix (the
export succeeds with Inpt [31, 255]) and passes with it.

Fixes #8530
2026-10-30 20:12:26 -07:00
qvest-sselsandClaude Sonnet 5.5 13f84218e3 feat(ui-egui): export dialogs start in the last exported folder (#10192)
Export As, Quick Export and Save for Web now start in the folder of the
last successful export (new preference export.lastFolder, kept across
restarts), falling back to the document's folder when none is remembered
or the folder is gone. Save As and non-export save dialogs are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-31 03:04:59 +01:00
David Mann e5b4ea6781 Merge main at e7b7cf11e into integration batch 10
i18n catalogs: main's new rows (#10328) appended after the batch's, as a union.
2026-10-31 02:05:31 +01:00
dotCooCoo 1001972059 Merge main into feat/equalize-entire-image 2026-10-30 12:30:15 -07:00
David MannandClaude Opus 5.5 f9b4e677c4 Tests: Rasterize Layer Style keeps a tagged CMYK document's inks (#4035)
#4035's only code change makes Rasterize Layer Style separate its RGB bake
through the document's own CMYK profile, but none of its tests ran that
command (they cover Flatten, Stamp and Merge, which already worked), so
removing the change left every test green.

New test: a tagged CMYK document's layer gets a drop shadow that falls off
the canvas and is rasterized; the inks must come back within the profile's
round trip. Without #4035's change they move by 35 levels (0.137) and the
test fails; with it they pass at 8 and 16 bits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 19:14:28 +01:00
Joe 763d193eca fix(psd): a stored Puppet Warp mesh is drawn only while its triangles cover their box a bounded number of times
The engine's stored-mesh limit matches the importer's (65 536 vertices).
2026-10-30 22:41:02 +07:00
Joe e1269d3e33 Merge upstream/main into feat/psd-puppet-warp-2
Upstream moved the smart-object import into Ctx::smart_content; the
imported Puppet Warp meshes are pinned to their placement there.
2026-10-30 22:40:33 +07:00
David MannandClaude Opus 5.5 d9cb0edd8d Liquify: no Twirl Counterclockwise tool, Alt with Twirl Clockwise does it
The reference application's Liquify has Twirl Clockwise only; holding
Alt (Option on macOS) while using it twirls counterclockwise. PhotoCraft
had an extra Twirl Counterclockwise tool on the strip, and #9598 had just
given it a mirrored icon.

Twirl Counterclockwise leaves the tool strip (LiquifyTool::ALL, 11 to
10 tools) and the rotate-ccw icon #9598 added goes with it (asset,
icon_data entry, ATTRIBUTION count back to 113). Alt already reversed
Twirl Clockwise at stroke-down; that stays. The TwirlCcw variant stays as
a stroke's direction: Alt-strokes record `twirlCcw`, and filter.liquify
strokes and older saved strokes naming it still replay as Twirl
Clockwise reversed (the command doc says so). Selecting it as the tool
(control channel `tool: "twirlCcw"`, or a preference saved by an older
version) is refused with an error that says to choose twirlCw and hold
Alt; the rest of the settings still apply and the dialog opens.

Tests: the_tool_strip_has_no_twirl_counterclockwise (no such tool, label
or missing icon on the strip, C is Twirl Clockwise, `twirlCcw` as the
tool is an Err and leaves the tool, an old saved preference naming it
opens); alt_with_twirl_clockwise_twirls_counterclockwise (the field
displacement a dab leaves right of the centre points up without Alt and
down, mirrored, with Alt). twirl_counterclockwise_has_its_own_mirrored_icon
and the twirlCcw row of alt_reverses_twirl_and_swaps_pucker_and_bloat
are removed. The i18n labels for Twirl Counterclockwise stay (the
variant's label).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:34:03 +01:00
David MannandClaude Opus 5.5 f151843591 Type: a copied type layer gets the destination's point size, not a transform
#9594 fixed type copied between documents of different resolutions
re-laying out at the wrong size on its next edit by running the Image
Size resolution step on the copies: the type kept its point size
(24 pt) and got a compensating transform of src/dst ppi, with box and
path text scaled up to match.

The reference application, measured by script, keeps the pixels and
rewrites the point size instead: 24 pt copied from a 72 ppi document
into a 300 ppi one becomes 5.76 pt (24 x 72/300), and 24 pt from
300 ppi into 72 ppi becomes 100 pt. There is no transform, the
Character panel shows the rewritten size, and later edits keep it.

adapt_copies, which both Copy Layers to Document (Duplicate Layer to
another document, dragging layers between documents) and Paste of a
copied layer go through, now calls canvas_geom::retarget_type_resolution:
every size in points is multiplied by src/dst ppi (font size, leading,
baseline shift, first-line/start/end indents, space before/after) and
the PSD TySh is rebuilt. Box, path and transform are in pixels and stay
as they were; tracking, kerning and auto leading are relative to the
size and stay too. A resolution that isn't a positive number counts as
72 ppi (what the text engine lays it out at), and the scaled sizes stay
finite and above zero. Image Size keeps its own behaviour.

Tests: copy and Paste in Place, 72->300 (5.76 pt) and 300->72 (100 pt):
leading, baseline shift and indent scale, tracking stays, no transform,
the same ink bounds as the source, and after an edit the size is kept
and bounds and coverage match the source's render. Paragraph text keeps
its box and wrapping. Bad and absurd resolutions don't panic or produce
non-finite sizes. The #9594 test is replaced by these.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 16:34:03 +01:00
dotCooCoo f121865ffa Docs: a .pcraft save can leave the full-size composite out
The doc.save row, docs/development.md, the MCP doc_save description, the
file.saveACopy params text, the --pcraft-full-composite help and the
option's doc comments said the option writes composite/full.png. A save
leaves it out when the canvas is past 2^26 pixels, when its pixels cannot
be allocated or encoded, or when a ZIP bundle would pass its limits. They
now say so and point to the manifest's full_composite member, which names
the entry when it was written.
2026-10-30 08:20:23 -07:00
David Mann 8e01f18a37 Merge PR #8725: feat(ui): Photoshop Fill/Stroke popover and full Color Picker for every colour swatch 2026-10-30 16:07:08 +01:00
David MannandClaude Opus 5.5 bf80e2d2fa Select and Mask: Shift Edge is a curve on coverage, so hard edges stay put
#5176 made ±100% move the edge by max(radius, feather, 2σ smooth), at
least 1 px. Measured in the reference application (a 100 px square,
Radius/Feather/Smooth each varied, Shift Edge -100/-50/+100):

- A hard selection does not move at all, at any Shift Edge.
- On a feathered edge the result is a fixed per-pixel curve, the same at
  2, 5 and 10 px feather: the pixel's odds a/(1-a) are multiplied by
  49^(shift/100). At -100% a 50% pixel becomes 2%, at -50% 1/8, at
  +100% 98%. The fit holds within ±0.05 in log-odds on every sample.

So Shift Edge is now that curve, applied last as before. It needs no
neighbours, so the morphology callback and the halo/spread it added are
gone, with the ignored benchmark that timed it (matting::morph itself
stays for Select › Modify and the mask view).

Tests: a hard edge is unchanged at ±50/±100%; seven measured
before→after coverage pairs; a feathered edge is pulled in; the engine
refine tests now check the hard edge stays and a feathered one moves.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 14:58:18 +01:00
David Mann c5ad3ed53b Merge PR #9274: Support editing selected color channel sets
# Conflicts:
#	docs/gaps.md
#	docs/ui-parity.md
2026-10-30 14:28:46 +01:00
David Mann b2db24400e Merge main at b1cfff9d3 into integration batch 10
Conflicts resolved as unions of both sides: codecs re-exports (PngRows + TiffBands), smart_cmds source imports
(main's source_surface_from_buffer and cache API with #8571's svg_source_image_in/convert_svg_source; main's
duplicate rendering import dropped), io flat.rs test modules (#8536's banded TIFF tests and main's PNG ones),
menus/invoke.rs (#8571's smart SVG intercept and main's layer.selectUnderCursor), state.rs (#8311's
type_box_overflow and main's type_insertion_style), the canvas_geom test keeps the is_finite guard, docs
status lines keep both change lists, i18n catalogs keep both sides' rows (hi.tsv: main's wording where both
added the same string).
2026-10-30 14:28:02 +01:00
Vlad Grankovsky 7da275ea6d Merge origin/main into codex/multi-channel-editing
Integrate main b1cfff9d3, preserving both canvas and Curves test suites and progress-document updates. Match the fused channel-selection blend to main's HDR-safe formula and cover full-coverage edits over extreme float values.
2026-10-30 14:28:01 +01:00