Commit Graph
68 Commits
Author SHA1 Message Date
David Mann ebb7e767de Merge #18007 into the merge queue batch
History Brush: Indexed and Bitmap documents refuse a source of another colour mode
2026-11-30 00:25:18 +01:00
David Mann 501c8f44af Merge #18006 into the merge queue batch
Shift+[ / ] leave a sampled brush tip unchanged
2026-11-30 00:25:18 +01:00
David Mann 3f52e9cb2b Merge #18005 into the merge queue batch
Brush on a Grayscale document's mask paints the foreground's grey from the document's grey profile
2026-11-30 00:25:17 +01:00
qvest-ssels 2b84752bdf History Brush: Indexed and Bitmap documents refuse a source of another colour mode (#17841) 2026-11-29 19:33:40 +01:00
David Mann 37c44857a6 Merge #14516 into the merge queue batch
History Brush and Art History Brush: a one-layer source paints any pixel layer (#12620)
2026-11-29 18:27:44 +01:00
qvest-ssels ede14208aa Shift+[ / ] leave a sampled brush tip unchanged (#17635) 2026-11-29 18:13:11 +01:00
qvest-ssels 682b11136e Brush on a Grayscale document's mask paints the foreground's grey from the document's grey profile (#17644) 2026-11-29 18:03:26 +01:00
David Mann fc7c5e41aa Merge #17823 into the merge queue batch
Pencil: a Grayscale document takes the foreground through colour management (#17559)
2026-11-29 12:44:26 +01:00
terminalgate 71fb042520 History Brush: the live stroke uses the inherited target too (#12620)
LiveRetouch::begin looked up the History Brush source with the raw
params, so with an alpha channel targeted in the Channels panel the
one-layer pixel rule let the live stroke paint while the commit, which
gets the injected target, refused it. Inject the target first, as the
Clone Stamp branch does.

The one-layer source tests now start from crate::session(), so they
install this crate's commands themselves instead of relying on another
test having done it.
2026-11-29 10:54:12 +00:00
terminalgate 8660594035 Merge origin/main into fix-history-brush-single-layer-source 2026-11-29 10:35:01 +00:00
qvest-ssels cd8a606c04 Pencil gray: read the foreground in the session's working RGB (#17559) 2026-11-29 11:21:40 +01:00
qvest-ssels eac5901559 Pencil: a Grayscale document takes the foreground through colour management (#17559)
The Pencil's colour goes through craft-cms into the document's gray
(relative colorimetric, black point compensation) instead of the
Rec. 601 luma sum: the gray profile in 8 and 16 bit, its linear version
in 32 bit. 30,120,200 paints 63.9 % ink in Gray 8 and 82.7 % in Gray 32
(reference 63.5 and 82.7). Masks, channels and documents outside the
default gray working space keep today's colour.
2026-11-29 11:02:23 +01:00
David Mann e7eceee2d6 Merge #17597 into the merge queue batch
fix(engine): name a Gradient mode drag into a layer mask (#17519)
2026-11-29 09:50:24 +01:00
FredApps a3288779f1 Reuse cached text bounds during layer picking (#17584)
* Reuse cached text bounds during layer picking

* Scan cache misses outside the bounds lock and respect concurrent Purge
2026-11-29 09:49:11 +01:00
kubuntugamerandCodebuff d445d93026 fix(engine): name a Gradient mode drag into a layer mask (#17519)
A Gradient mode drag with a layer mask targeted recorded its History state
as "Gradient"; the reference application names it "Draw gradient on mask".
The step name now follows the paint target, and every other target (pixels,
an alpha channel, Quick Mask, a filter mask) keeps today's name.

Co-Authored-By: Codebuff <[email protected]>
2026-11-28 23:09:13 -06:00
David Mann c2373866c8 Merge #17525 into the merge queue batch
Fill: Dissolve takes the opacity as a whole percent (#17480)
2026-11-29 04:41:29 +01:00
David Mann 3a75aa43c9 Merge #17418 into the merge queue batch
Apply Brush Pose pressure to samples without pen data
2026-11-29 04:41:26 +01:00
qvest-ssels 136c30ba19 Fill: Dissolve takes the opacity as a whole percent (#17480)
A scripted 50.4 % Dissolve fill paints exactly the 50 % pattern and
50.6 % the 51 % one, as in the reference. Other modes keep the
fractional opacity.
2026-11-29 00:33:39 +01:00
4a66e6ccdc Merge main into #14274 (Paint Bucket Behind)
Resolves the conflict in the bucket options bar: main's Healing Brush list,
Source tooltip and change-only mode writes, with this PR's Behind mode.

Co-Authored-By: chamber074 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-28 23:04:01 +01:00
yoriswind dbc4d242b9 fix(paint): reject malformed pressure provenance before painting 2026-11-28 12:42:26 -08:00
yoriswind 671d0d0e3f Preserve numeric pressure and provenance through stroke replay 2026-11-28 10:13:18 -08:00
yoriswind c8b17bab3e Apply Brush Pose pressure to samples without pen data 2026-11-28 09:51:49 -08:00
qvest-ssels 94ba7afff6 Dodge and Burn: single-channel curve in 8-bit Grayscale and on layer masks (#12675, #12689)
In an 8-bit Grayscale document and on a targeted layer mask, a default
Dodge or Burn click (Midtones, Protect Tones on, Exposure 50 %) now uses
its own single-channel curve, fitted to the reference's six measured
greys: Burn v - 0.236*v*(1-v)^1.15, Dodge v + 0.094*v^0.2*(1-v). Both
land within 1 level of every measured point (Burn 32/128/224 -> 26/114/219,
Dodge -> 46/138/227; before: 23/91/218 and 46/161/228).

RGB documents, 16- and 32-bit Grayscale and masks, the other ranges and
exposures, Protect Tones off, alpha channels, the Quick Mask and filter
masks were not measured and keep the RGB curve.
2026-11-28 12:36:16 +01:00
David Mann 7aa6a5ab96 Merge #14814 into the merge queue batch
History Brush restores transparency instead of painting over (#14701)

# Conflicts:
#	crates/engine-paint/src/cmd/retouch_cmds/heal.rs
2026-11-27 17:17:43 +01:00
David Mann 887e4d1c0e Merge #16454 into the merge queue batch
Burn: tone a 32-bit document's linear values with the reference's curve
2026-11-27 17:17:42 +01:00
David Mann 7c0965d517 Merge #16223 into the merge queue batch
Make a Red Eye press outside the selection silent
2026-11-27 12:51:07 +01:00
David Mann 4bd8ad3ba8 Merge #16453 into the merge queue batch
Dodge: tone a 32-bit document's linear values with the reference's curve
2026-11-27 12:51:06 +01:00
qvest-ssels 5c68cce9bb Merge main into fix/history-brush-transparency-14701
# Conflicts:
#	crates/engine-paint/src/cmd/retouch_cmds/history_brush_transparency_tests.rs
2026-11-27 10:21:45 +01:00
qvest-ssels f0c11b4c19 Red Eye test: build the session with crate::session() after the engine split 2026-11-27 09:08:43 +01:00
qvest-ssels d74a2937bd Merge main into fix/red-eye-outside-selection-silent-13096 2026-11-27 08:51:36 +01:00
qvest-ssels 3e59fbae77 Merge main into fix/dodge-32bit-linear-12687
# Conflicts:
#	crates/engine-paint/src/cmd/retouch_cmds/dodge_32bit_linear_tests.rs
2026-11-27 07:01:46 +01:00
qvest-ssels 4ce5233a95 Merge main into fix/burn-32bit-linear-12674
# Conflicts:
#	crates/engine-paint/src/cmd/retouch_cmds/burn_32bit_linear_tests.rs
#	crates/engine-paint/src/cmd/retouch_cmds/dodge_32bit_linear_tests.rs
2026-11-27 07:01:38 +01:00
hnoerenberg a438a96675 test(retouch,ui): pin the Replace rim, widen its exact disc, and test the dropdown pick (#12101)
Review round one: a hardness-50 dab pins that Replace at partial coverage composites the
source through the coverage (strictly between ground and source at the rim, exact copy at the
centre); the bit-exact loop widens to the full-coverage disc of the 20 px hard tip, measured at
221 pixels (pixel-centre distance under 9 of the 10 px radius); and the options bar dropdown
route is now click-tested end to end: open Mode, pick Replace, the stroke would send
mode:"replace" and no History step is added, pick Multiply and Replace is left.
2026-11-27 00:43:55 +01:00
hnoerenberg 1f486fbc1c style: rustfmt on the new #12101 test files 2026-11-26 22:56:22 +01:00
hnoerenberg de75f47644 feat(retouch): paint.healingBrush accepts mode "replace" as a straight source copy (#12101)
The Healing Brush's Replace row, measured in the reference application: the
stroke copies the source pixels with no healing solve, composited through
Normal. `blend_param` accepts the exact word "replace" for `paint.healingBrush`
alone, so the live stroke parser starts too (its texture preview already draws
what Replace commits); every other command keeps refusing it, and an unknown
mode string stays an error. `healing_brush` reads the word from the params and
paints the sampled source region as it stands: the Normal and other modes run
the unchanged solve path, pinned pixel-for-pixel by the tests.
2026-11-26 22:29:42 +01:00
hnoerenberg 752d83c078 test(retouch): the Healing Brush Replace stroke copies its source exactly (#12101)
Red: `paint.healingBrush {"mode":"replace"}` is refused today ("unknown blend
mode `replace`"). The new file pins what the ticket measures: every pixel the
hard tip covers fully equals the source pixel mapped there, bit for bit, taken
from the document state before the stroke; Normal's healed pixels are pinned
byte for byte; an unknown mode string stays an error; and one Replace stroke
is one History step named "Healing Brush".
2026-11-26 22:28:42 +01:00
hnoerenberg b22cd5627b test(retouch): size the Remove test buffers by their own types
`Surface::channels` already answers in usize, so casting it again is a
warning; the two rectangle widths are the values that need the step to
usize for a byte count.
2026-11-26 00:11:25 +01:00
hnoerenberg e6af9c6d27 test(retouch): pin the Remove smart-object neighbours
The Smart Object case newly reaches paths that were refused before, and
the ticket leaves several of them unmeasured, so each is pinned to the
rule the rest of the tool already follows instead of left to be read out
of the code:

- Sample all layers over a Smart Object with a differently coloured layer
  beneath it: a layer is added either way, and only the option reads the
  composite, which the colour of the layer below shows in the fill.
- A linked Smart Object: the same path, and it stays linked.
- The "layer" parameter decides the path, not the active layer, in both
  directions.
- The next press after a removal belongs to the now-active edits layer
  and adds no second layer.
- A hidden Smart Object is refused before the rasterize question is
  reached: no prompt, no collected stroke, no layer, no history state.
- The card's Don't show again button is clicked, its dismiss key is read
  back from the preferences, and a later removal brings no card.

Two of these setups were wrong in the first run of this file: the
pixel-layer case used a Smart Object document, and the card button was
looked up by the wrong accessible name. Both are corrected here.
2026-11-26 00:01:00 +01:00
hnoerenberg b4cf5d20a0 fix(retouch): the Remove notice waits for the job's result
The notice about the new layer above a Smart Object was posted from the
result of the run call. On this desktop `paint.remove` runs as a
background job, so that call returns only the job number: the card never
appeared where users would see it, and only the inline path (the web
build, and the shell's own tests) ever showed it.

The removal now says in its own result when it wrote to a new layer above
a Smart Object (`smartObject`), and the interface reads that marker on
both paths: straight after an inline run, and in the job-end handler when
the job lands. A cancelled or failed removal has no such result and stays
quiet, and a plain Create new layer removal carries no marker, so nothing
else starts noticing.

Fixes #12555
2026-11-26 00:00:48 +01:00
hnoerenberg 0be698eb85 fix(retouch): a Remove stroke on a smart object edits a new layer
The Remove tool is a pixel tool, so a press on a Smart Object layer opened
the rasterize prompt and nothing was removed until the layer was rasterized.
The reference application instead keeps the smart object intact: the fill
goes to a normal pixel layer named "Remove tool edits" directly above it,
even with Create new layer off, and the first such removal says so.

intercept lets the Remove tool's Smart Object press through to the tool;
the type, shape and fill prompts are unchanged. paint.remove treats a
Smart Object target as the new-layer case whatever "newLayer" says: the
hole is filled from the smart object's rendered pixels, read through
read_target_surface after the same pixel-lock check the painted case
makes, and the fill lands above it. Its precondition now admits a Smart
Object with pixels to sample. The options bar sends newLayer for that
target as well, so the params say what will happen, and after such a
removal the app posts the notice with its dismiss key, so the card offers
Do not show again and later removals stay quiet.

A second removal of the same smart object, Sample All Layers over one, and
the notice after it was closed are not measured in the reference: they
keep the new-layer path's behaviour, pinned by tests.

Fixes #12555
2026-11-25 22:21:30 +01:00
Josias Eli Rodriguez c36d5d83b8 bucket_behind_tests: build the document on the installed test session
The crate split moved paint.bucket's registration behind the engine's
install step; Session::new() answers NotInstalled. Use crate::session()
like the sibling bucket test files.
2026-11-25 10:39:53 -06:00
Josias Eli Rodriguez ca4203be86 Merge remote-tracking branch 'upstream/main' into HEAD
# Conflicts:
#	crates/engine-paint/src/cmd/paint_cmds.rs
#	crates/engine-paint/src/cmd/paint_cmds/bucket_behind_tests.rs
#	crates/ui-egui/src/canvas/tool_input.rs
#	crates/ui-egui/src/options_bar_mode_wheel_tests.rs
#	crates/ui-egui/src/panels/brush_controls.rs
#	crates/ui-egui/src/panels/options_bar.rs
#	crates/ui-egui/src/tools/retouch_ui/tests.rs
2026-11-25 10:39:53 -06:00
David Mann eff5cf198a Merge #16065 into the merge queue batch
Define Brush Preset: tips up to 5000 px, unavailable for larger areas (#14275)
2026-11-25 17:31:42 +01:00
David Mann 44c2a2937d Merge #16479 into the merge queue batch
Patterns paint the grey profile's greys in Grayscale documents (#14975)
2026-11-25 17:31:39 +01:00
David Mann 50fd48a706 Merge #16533 into the merge queue batch
fix(paint): Color replacement reads and writes through the document's CMYK profile (#11918)
2026-11-25 13:28:30 +01:00
David Mann 601548579c Merge #16558 into the merge queue batch
fix(retouch): Content-Aware patch fills from surroundings instead of pasting the source (#12118)
2026-11-25 13:28:28 +01:00
David Mann b8eea8463d Merge #15990 into the merge queue batch
Fill and Stroke grey the modes the document can't use (#14647)
2026-11-25 13:28:25 +01:00
David Mann ec236094ca Merge #16638 into the merge queue batch
fix(tools): a pattern from an Indexed image keeps painting (#13071)
2026-11-25 13:28:24 +01:00
hnoerenberg 5068320297 fix(paint): blend Color replacement on the CMYK channels of the document
In a CMYK/8 document the Color mode no longer takes the pixel through the RGB
blend space. It follows the rule ISO 32000-1 11.3.5.3 gives for a non-separable
blend in a CMYK space, which is what the issue's four numbers come from: C, M and
Y complemented, blended like RGB - Color is SetLum(source, L(backdrop)) with
ClipColor pulling the result back into gamut towards grey, the step that keeps the
lightness of the BOTTOM layer - complemented back, K from the backdrop. Hue,
Saturation and Luminosity in CMYK, and CMYK/16, keep the RGB blend: the issue
leaves them unmeasured. RGB, Grayscale and Lab documents are untouched, and the
tolerance match still reads the pixels as RGB.

The foreground's inks come from the pick when it was picked as CMYK
(ReplaceSettings::color_inks, the pair a Brush stroke already carries, #4196 and
#4344), and from its RGB through the document's CMYK profile otherwise: the
profile plumbing of this branch is what turns the picked colour into the
document's channels.

Measured with the tests added by the previous commit (40 px hard tip, pure blue
foreground, Mode Color, one click each, the issue's document converted to CMYK/8;
the table is C89 M71 Y0 K1 / C42 M34 Y0 K0 / C55 M44 Y0 K0 / C91 M72 Y0 K4):

- Coated FOGRA39, the CMYK space those numbers were measured in: C89.41 M70.59 Y0
  K1.18, C41.18 M32.55 Y0 K0, C55.69 M43.53 Y0 K0.39, C91.37 M71.76 Y0.78 K5.10 -
  every ink within 1.5 percentage points.
- No profile at all, the backdrop filled with the inks the reference measured and
  the foreground picked as C93.33 M74.60 Y0 K0: C89.02 M71.37 Y0 K0.78, C42.75
  M34.12 Y0 K0, C55.69 M44.71 Y0 K0, C90.59 M72.55 Y0 K4.31 - within 0.8.
- PhotoCraft's own default working space (the built-in coated profile), which is
  not FOGRA39: C74.90 M77.25 Y0 K0, C34.51 M35.69 Y0 K0, C41.18 M42.75 Y0 K0,
  C76.86 M79.22 Y0 K0. That space renders pure blue as C96.86 M100 Y0 K0 and a
  Color blend takes its hue from the foreground, so the result's C and M follow
  that ratio rather than the table's 89 : 71, and it makes no K from these four
  colours, so the table's K1 and K4 cannot appear there either.
2026-11-25 01:41:31 +01:00
hnoerenberg b8d89b3a28 test(engine-paint): ask the CMYK Color click for the ink table of #11918
The Color mode of Color Replacement in a CMYK document has to keep the lightness
of the pixel it lands on. The issue's table is the measurement of that: on its
test document converted to CMYK/8, one click each with a pure blue foreground and
Mode Color, the reference application stores

| click | inks |
|---|---|
| red stripe | C89 M71 Y0 K1 |
| green stripe | C42 M34 Y0 K0 |
| pink stripe | C55 M44 Y0 K0 |
| block 0 | C91 M72 Y0 K4 |

within 3 percentage points per ink. The tests now ask for those four rows instead
of the inks today's RGB round trip stores, in a document converted with Coated
FOGRA39 - the CMYK space those numbers were measured in.

The other tests of the file follow the same ruling: a fixture that needs no
profile at all (the backdrop filled with the inks the reference measured for those
four pixels, the foreground picked as C93.33 M74.60 Y0 K0), a lightness test that
compares the ink-space luminosity of the pixel before and after the click, and the
profile-plumbing test re-derived from the ink-channel rule. Hue, Saturation and
Luminosity in CMYK, CMYK/16 and RGB documents stay on their existing pins: the
issue leaves them unmeasured.

Seen red on this head before the blend change: 5 of 11 failed
(the_four_clicks_land_on_the_issue_s_ink_table_in_the_space_it_was_measured_in
stores C74.90 where the table asks for C89, the_color_blend_follows_the_ink_rule_
without_a_profile stores C96.08, the_color_click_in_the_working_colour_space_
blends_on_the_ink_channels stores C96.08 M100, the_color_click_keeps_the_pixel_s_
lightness moves the pixel's lightness to the foreground's, and
color_blend_in_cmyk_converts_through_the_documents_cmyk_profile keeps the
RGB-round-trip inks). The 6 passing tests pin today's output and pass both ways.
2026-11-25 01:16:45 +01:00