Replace Color had one eyedropper and matched one colour. As in Photoshop, its
dialog now has the Eyedropper, Add to Sample and Subtract from Sample tools
(Shift-click adds, Alt-click subtracts), and image.adjustments.replaceColor
takes several points, subtractPoints and their click order. Several samples
match through Select › Color Range's own matcher, so the two agree for the
same clicks; a single colour keeps the existing path.
Fixes#6280
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- #11458: the straight-crop rows also check that the active layer's pixels
inside the old canvas are the plain crop's, so a fill that recolours them
fails.
- #11295: the Esc case sends the key through shortcuts::handle instead of
calling cancel directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In the app (background jobs on) edit.transform runs as a job and lands
after app.run returns, so renaming the top History step to "Transform
Path" right away renamed the step before it (the second shape's "New
Shape Layer") and left the scale as "Free Transform". Found in the batch
smoke run; the PR's tests run with background jobs off.
edit.transform now takes stepName "Transform Path" (any other name is
refused, as select.transformSelection's stepName from #11444), and the box
passes it instead of renaming afterwards. New tests: the box with
background jobs on (fails without the fix), and the parameter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Channels: the panel menu has the channel commands, New Spot Channel among them (#11451)
The Channels panel's menu had no channel items, so New Spot Channel... and
the rest could only be reached from a row's right-click menu. It now lists
New Channel..., Duplicate Channel, Delete Channel, New Spot Channel...,
Merge Spot Channel, Channel Options..., Split Channels and Merge
Channels..., each acting on the targeted channel and greyed where it can't:
Duplicate takes a single colour, alpha or spot channel, the composite of a
one-channel image, the Quick Mask or a targeted layer mask. Channel
Options... in Quick Mask mode now opens the targeted alpha or spot
channel's options, not Quick Mask Options. The panel menus run their
commands through the menu bar's enabled rules, so the Layers panel menu
greys its dialog items the same way too. The labels are in every catalog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Channels: New Channel... and Merge Channels... ask first, from the panel and row menus (#11451)
The panel menu's Merge Channels... ran channel.merge with no parameters, and
the engine merged the first grayscale documents into RGB and closed them with
no choice; New Channel... added a channel straight away. Both now open a
dialog when called without parameters, as New Spot Channel... and Channel
Options... already did: New Channel... reuses the Channel Options dialog
(name, colour indicates, colour and opacity), and a new Merge Channels
dialog picks the mode and the open grayscale document for each channel. The
channel rows' menu had the same two items and goes through the same path.
With parameters (scripts, the New button) both still run at once.
The Merge Spot Channel test now checks pixels, so a delete couldn't pass it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Channels: Merge Channels waits for three grayscale documents and the dialog offers only modes they fill (#11451)
With two grayscale documents open, Merge Channels... was enabled and its
dialog repeated a document for the third channel; OK then failed in the
engine and the dialog closed. The engine's rule now needs three documents
of one size (no mode merges fewer), so the menus grey the item below that.
The dialog offers only the modes the open documents can fill (RGB and Lab
from three, CMYK from four), greys OK with the reason while the picks
repeat, keeps itself open when OK is refused, and comes back with the
engine's message if the merge itself fails.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Channels: the Merge Channels dialog keeps its picks by document id (#11451)
The dialog kept the picked source documents by tab index, and background
work can still run while it is open, so a document moved or closed in the
meantime could leave another one at a picked index; OK would then merge,
and close, the wrong document. The picks are now document ids, resolved to
the current tabs when OK is pressed: a closed pick, or one that is no
longer a grayscale document of the same size, is refused with the reason
and the dialog stays open.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Main already has Add Path to Selection (⇧⌘↩) and Subtract Path from
Selection (⌥⌘↩) as engine commands (#8015). This adds the third,
path.intersectWithSelection (Cmd+Alt+Shift+Enter), next to them:
path.toSelection with mode "intersect", loading the path selected in
the Paths panel (or the one being drawn) from the UI as the other two do.
Tests: an engine test that the three fixed-mode commands match
path.toSelection with their mode whatever mode the params ask for, and
a UI test pressing ⇧⌘↩, ⌥⌘↩, ⇧⌥⌘↩ and ⌘↩ through the egui input, with
Photoshop 2025's areas for the same document (7200, 5200, 800, 2000 px).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Since #10867 the non-deleting crop turns a 2000 px layer to 2001 px bounds, so
the budget refusal names 200100 x 200100 px.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fit_canvas's (i32, i32) shift is now #[must_use], so a caller can't drop it
and leave the Color Sampler points and painting symmetry behind. That
flagged the last caller that still dropped it: Layer > Duplicate on a board
(place_copy, single and several layers). place_copy now returns the shift and
both duplicate paths pass it to follow_shift. It is non-zero when another
board was already past the origin, as an imported PSD can hold.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scale_effects (Image Size's Scale Styles, Layer Style > Scale Effects, the
Free Transform style preview) now clamps the Pattern Overlay, Bevel & Emboss
Texture and pattern Stroke scales to the 1..1000 % the Layer Style dialog
allows, through one shared photocraft_doc::effects::PATTERN_SCALE_RANGE that
the layer style param parser now uses too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
x/y of 0 count as given, numeric strings are refused on every side, a
rectangle partly past the canvas grows it as passed, and Reveal All
(crop_keeping_background) still crops to all four sides with a selection
active.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The donor check indexed the label buffer directly; the bounds are inside
the canvas today, but a lookup that is out of range now counts as no donor
instead of panicking.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* GPU plan: cache adjustment LUT rows between plans (#11498)
adjustment_program rebuilt the Levels/Curves tone tables on every plan
(twice per refresh), about 1-2 ms per Levels layer each time. Keep the
rows of Levels, Curves, Color Balance and Hue/Saturation ranges in a
32-entry most-recently-used cache (photocraft_compose::lut_rows, at
most 32 x 3 x 16 KiB = 1.5 MiB), built outside the lock.
Entries are keyed by a u64 hash of exactly what each row builder reads,
fields destructured in full and floats by bits (-0.0 and 0.0 stay
apart). Hue/Saturation master sliders don't add entries; Hue/Sat ranges
and Color Balance don't depend on depth. Edit > Purge > All drops the
cache, and a filled cache enables it.
Release, per call: Levels 8/16-bit 1.10 -> 0.003-0.018 ms, Curves
0.16 -> 0.018, Color Balance 0.11 -> 0.001-0.015, Hue/Sat ranges
0.05 -> 0.008-0.018. The tables are identical, so rendering is unchanged.
Tests: cached rows match fresh tables bit for bit at 8/16/32-bit, hits
and LRU eviction on a local cache, key coverage, and Purge All
releasing the cache.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* compose: rustfmt the LUT row cache tests (#11498)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* GPU plan: test that plans read cached LUT rows and that curve points key them (#11498)
Plant rows no builder makes under a fresh key and check the planner returns
them, and check that moving a Curves point changes its key (review on #11539).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* compose: prevent in-flight LUT builds from undoing purge
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: FredApps <FredApps@users.noreply.github.com>