Commit Graph
570 Commits
Author SHA1 Message Date
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
qvest-ssels 5ec2e5a7a9 fix(compose): honour Anti-aliased for the Drop Shadow map (#14881)
The Drop Shadow now takes the same third-of-a-pixel source offset the
Inner Shadow takes since #14934, through the same aa_shift gate (Gaussian
contour, no dilating Spread, a blur wider than the identity), on the CPU
(shadow_map) and the GPU map program (B::shadow). On the issue's document
the edges land within 2 levels of the measured profiles; the flag off
keeps every map bit-for-bit.
2026-11-28 16:54:44 +01:00
David Mann 3597c13275 Merge #15766 into the merge queue batch
Cover translucent raster pixels with Inside and Center strokes (#15002)
2026-11-27 12:08:38 +01:00
Dan 9f81f17b2d Use document layer lookup in the cache regression 2026-11-26 18:46:07 +00:00
Dan d2dec04f01 Invalidate group effect maps when a child changes type 2026-11-26 18:27:10 +00:00
qvest-ssels ee10c0804e Color Settings: Blend Text Colors Using Gamma is a checkbox with a 1.00-3.00 field
Blend Text Colors Using Gamma was a 1.0 to 2.2 slider where 1.0 meant off, so turning it off and on lost a custom value. ColorSettings now keeps the field's value (blend_text_gamma, 1.00 to 3.00, two decimals) and the box (blend_text_gamma_on) apart; text_gamma() is what the compositor blends in (1 while the box is off), and the compositor takes up to 3.00. edit.colorSettings still takes a bool for blendTextGamma (the box alone) or a number in range (the value, and the box checked), plus blendTextGammaOn. The dialog shows the checkbox with the field beside it: typing a value checks the box, focusing does not, an out-of-range value alerts "A number between 1.00 and 3.00 is required. Closest value inserted." and an emptied field puts its value back. Settings saved as one number still load: 1 as the box off with 1.45, any other value as the box on with that value (#14243).
2026-11-26 17:22:41 +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 b30a4b0bae Merge #16661 into the merge queue batch
Outer Glow: one Range/Size rule for Softer Edge glows (#15871)
2026-11-25 13:28:26 +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
David Mann 77b7358fbf Merge #16200 into the merge queue batch
Modern Brightness at +150 and -150 matches the reference ramps (#14348)
2026-11-25 13:28:21 +01:00
RickiNano b1100518a1 Modern Brightness: each input rises with the slider up to ±150 (#14348)
Past +110 the curve mixed the slider's own roll-off with the fixed +150
fit. The power roll-offs come closer to white than that fit past about
input 220, so the mix fell there as the slider neared +150: input 200
gave 253.55 at +134 and 253.32 at +150.

The ease now starts at +109.5, the last Hermite roll-off, which stays at
or below the +150 fit everywhere, and mixes from the roll-off held at or
below the fit. Both parts of the mix then rise with the slider, and the
curve reaches the +150 fit itself at +150, so the measured ramps are
unchanged.

The new test steps the slider one unit at a time from ±100 to ±150 and
checks every 8-bit input; it fails on the previous curve.
2026-11-25 07:06:51 +01:00
RickiNano bab63cc90e Outer Glow: read the floor from the box end taps (#15871)
softer_edge_floor needs only the box end tap and its neighbour, so it
no longer builds the whole tent kernel (quadratic in the Size).
2026-11-24 15:38:28 +01:00
RickiNano f9c6b8b05e Outer Glow: one Range/Size rule for Softer Edge glows (#15871)
The Range 1 % fix from #15311 hardened an outer Softer glow only at
Size 10 / Range 1 %. Other small Ranges and other Sizes still reached
one pixel too far (Range 2: 96, 223 for 125; Size 20 at Range 1:
48, 175, 239 for 93, 201).

An outer Softer Edge glow with Spread 0 and the Linear contour now maps
coverage v through (v - floor) / (levels * (1 - floor)): the Range
rounded to a whole 8-bit level, less the tent's outermost tap when the
blur's box ends in half taps (even Sizes). That gives every measured
pixel of #15871 and #14958 (Range 1, 2, 25, 50, 100 at Size 10; Range 1
at Sizes 5 and 20) within 1 level. The GPU reads the same table through
glow_paint_lut. Inner glows keep today's table.
2026-11-24 14:43:30 +01:00
f2ac09d2ec Fix-up for #11756: Align Edges as the reference application renders it
The PR snapped shapes with a per-edge heuristic (pixel_align.rs, dash-cap tie
rules, a PSD coordinate-frame field threaded through engine, format and caches),
defaulted the option to off, and renamed the existing Rectangle/Triangle
"Align Edges" checkbox to "Snap Bounding Box" next to a second checkbox.

The reference application fits the whole shape at render time: the bounds of
what it paints (fill, or the stroke's outer edge) get a whole-pixel left/top
(a half rounds up) and a whole width/height, and the path is translated and
scaled into that box. Fill and stroke take one transform; curves stay
antialiased; inner edges of several subpaths are not snapped.

- photocraft_vector::align_edges implements that rule; CompiledShape applies it,
  so caches, the compositor, previews and extents agree; the fill/stroke split
  under layer effects starts from the whole shape's transform.
- Removed pixel_align.rs, the rasterizer helpers it needed, the document-space
  drag preview and psd_coordinate_frame (rounding the bounds absorbs the PSD
  quantization it was for).
- One Align Edges checkbox (ToolOptions::align_edges, stored and scripted as
  useAlignedRendering, older align_edges still read) on every shape tool and the
  Pen, on by default and after Reset Tool; it snaps the drag and sets the layer.
- PSD sn2P: written as 1 when on and left out when off, as the reference saves it.
- Dropped the dead path.set param, moved the control-protocol paragraph,
  rewrote docs/pixel-aligned-strokes.md, reverted the unrelated raw, font,
  Cargo and test-harness changes.
- Tests reproduce the measured cases (rectangles at .25/.4/.5/.6/.75, ellipse
  extremes and curve symmetry, 1/2/3 px strokes, rotated rect, Pen triangle,
  two subpaths, toggle off, stored path unchanged, one checkbox, Reset Tool).

Co-Authored-By: superplay2021 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 13:02:42 +01:00
hnoerenberg 818a4a010d feat(doc): patterns record the colour mode they were defined from
Edit > Define Pattern composites the area in the document's pixel format, which stores an Indexed Color document expanded to RGB. Nothing on Pattern said where the tile came from, so a pattern taken from an Indexed image was indistinguishable from an RGB one, and a tool that cares about the difference had nothing to read.

The new field names the source mode. The pixels, the id and what the pattern library lists stay as they were. A pattern read from a file records no source: a .pat or PSD block says what its pixels are, not which document they came from. The library index and .pcraft carry the field, so a defined pattern keeps its source across a restart or a save; files written before it read as no source.
2026-11-24 11:22:16 +01:00
ljkx 1bf4056082 Merge remote-tracking branch 'origin/main' into fix/14975-pattern-grayscale-greys
Main's engine split step 7 moved the paint modules to crates/engine-paint and
the pattern mode tests to the engine crate's tests/it:

- cmd/fill_cmds.rs was deleted from engine-core (git saw no rename): Edit >
  Fill's pattern tile is built in PatternSpace::of_pixels(doc) in
  crates/engine-paint/src/cmd/fill_cmds.rs.
- cmd/paint_cmds.rs followed its rename.
- pattern_mode_tests.rs is crates/engine/tests/it/paint_in_pattern_mode.rs:
  the tests this branch added start from the facade's Session::new(), which
  installs the commands, like the two that moved.

# Conflicts:
#	crates/engine-core/src/cmd/fill_cmds.rs
2026-11-24 01:27:05 +01:00
superplay2021 47790f5e0d Merge latest main and resolve Align Edges conflicts 2026-11-23 21:25:02 +02:00
ljkx ed726ead5c Patterns keep the luma greys where #14975 did not measure
The grey-profile conversion was keyed by the document's pixel-format colour
mode, so it reached more than the 8- and 16-bit Grayscale documents the
issue measured:

- 32-bit Grayscale documents;
- Duotone and Bitmap documents (their pixel format is Grayscale);
- Grayscale documents tagged with another grey profile (the transform
  always targets sGray);
- Image > Mode > Bitmap's Custom Pattern thresholds, which ask for the
  pattern in ColorMode::Grayscale.

The issue lists the first three as not measured, to keep their behaviour.

The conversion is now keyed by compose::pattern::PatternSpace.
PatternSpace::of(doc) is ProfileGray only for an 8- or 16-bit Grayscale
document in the default grey working space (untagged, or tagged with the
default grey profile, as swatch_in_doc asks of the document); every other
document, and every caller that names a colour mode, gets Mode(mode), the
pixel-format conversion main has. Edit > Fill and the Paint Bucket build
their tile in PatternSpace::of_pixels(doc), so they keep painting what a
pattern fill layer paints. The GPU compositor's pattern cache is keyed by
the same space.

PSD and layered-TIFF export render a pattern fill layer's stored pixels in
that space too (render_fill_content_in). They were rendered from the
pattern's own colours and converted by the pixel format, so a Grayscale
document's pattern fill layer reopened with the luma greys:
pattern_fill_survives_psd_and_layered_tiff_in_every_mode failed with
"Grayscale/U8 x.psd: the reopened pattern fill differs by 0.028272122".

The two engine tests this branch added started from a core Session::new(),
which installs no commands: they failed with NotInstalled when run alone,
as nextest runs them. They start from crate::session().
2026-11-23 18:10:16 +01:00
David Mann aa21256f7f Address CodeRabbit review on the restored batch
- CMYK Channel Mixer in a 32-bit document: the change is added as the
  difference of two round trips through the inks, so samples past 0..1
  keep their magnitude and an identity mixer leaves HDR highlights alone.
- PSD: a Channel Mixer block in PhotoCraft's old RGB layout (fourth record
  repeating the first, no black source) in a CMYK document keeps its RGB
  reading instead of setting the black ink to the cyan mix.
- Color Settings dialog: a Monitor Profile set before the first pass
  loads Monitor Color's working RGB at once, and Reset set before the
  first pass shows Custom.
- Test: the non-identity CMYK mixer check runs in RGB documents too.
2026-11-23 15:17:08 +01:00
David Mann 42236a89fa Merge remote-tracking branch 'origin/main' into HEAD
# Conflicts:
#	Cargo.lock
#	Cargo.toml
#	crates/engine-core/Cargo.toml
#	crates/ipp/Cargo.toml
#	crates/ui-egui/src/tools/analysis/tests.rs
2026-11-23 14:58:08 +01:00
David Mann 81cc69f17e Address CodeRabbit review; follow main's colour state accessors
- Curves at 8 bit: evaluate the channel and composite curves at the 256
  exact levels instead of between two entries of the 4096-entry table, so
  a pencil step between levels 128 and 129 no longer gives level 128 a
  fraction that rounds to level 4.
- Color Settings: a later Monitor Profile change keeps "Monitor Color"
  only while the values still are what Monitor Color would set.
- Color Settings dialog: a control changed by ui.dialog.set before the
  first pass shows Custom instead of becoming the baseline.
- Stored-channel edits (Lab/CMYK, CMYK Channel Mixer) mix through the
  selection as v*(1-k) + o*k, exact at full coverage over huge 32-bit
  values.
- Action playback: a Channel Mixer step the editor refuses reports the
  refusal instead of opening the generic step editor.
- Shortcut set test: assert Cancel closes the confirmation.
- Merge follow-up: Session's colour state is reached through
  ColorExt::color()/color_mut() on main now.
2026-11-23 13:31:11 +01:00
aiongg 3098631a38 Hue/Saturation range swatches and spectrum run the engine's adjustment on one colour 2026-11-23 06:06:58 +00:00
ljkx b654156cbd Patterns paint the grey profile's greys in Grayscale documents (#14975)
In a Grayscale document a colour pattern converted to grey with the luma
formula (blue 29, green 150, red 76). It now converts sRGB to the grey
profile, relative colorimetric with black point compensation, as the swatch
colours do: blue 69, green 221, red 129, as measured for a Pattern Overlay.

The conversion is shared by Pattern Overlay and pattern fill layers. Edit >
Fill and the Paint Bucket's pattern mode build their tile in the same mode
in a Grayscale document, so a fill layer still paints what Edit > Fill
paints. Other modes keep their conversion.
2026-11-23 03:03:35 +01:00
David MannandClaude Opus 5.5 877982cb0c fix(compose): CMYK split stand-ins keep ink Curves off whole levels
#14650 puts 8-bit RGB Curves output on whole levels. The CMYK split route
renders ink Curves as RGB stand-ins, so they were rounded too, while the
exact ink path is not: the two routes parted by one level
(cmyk::tests::the_split_route_agrees_with_the_exact_path). The stand-in
contexts now build unrounded Curves tables; RGB documents are unchanged.
The shrunk failing case is kept as a proptest regression seed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 02:22:09 +01:00
David Mann bd5515513f Merge #14650 into the merge queue batch
fix(compose): round the channel curve before the composite curve at 8 bit
2026-11-23 01:58:03 +01:00
David Mann 8d479ee9c2 Merge #15311 into the merge queue batch
fix(compose): Outer Glow Range 1 % follows the measured reach and hardness (#14958)
2026-11-23 01:58:02 +01:00
David Mann d321a2db62 Merge #15085 into the merge queue batch
fix(compose): Inner Shadow size 1 draws the measured pixel
2026-11-23 01:58:00 +01:00
Higgs32584andClaude Opus 5.5 b0e95488da Merge upstream main into fix/8047-channel-mixer-cmyk
Keeps both test modules in crates/format/tests/it/main.rs: main's camera_raw_roundtrip and this PR's channel_mixer_cmyk.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-22 12:56:48 -05:00
Dan db5bacddbb Merge upstream main into codex/15002-stroke-partial-alpha 2026-11-22 17:47:29 +00:00
superplay2021 e1ba70a49b Merge latest main and fix Align Edges test compilation 2026-11-21 22:31:23 +02:00
RickiNano 3da8da9955 Modern Brightness at +150 and -150 matches the reference ramps (#14348)
Past +110 the raised Brightness curve now eases into a curve fit to the
reference application's 8-bit +150 ramp: a line of slope 2.585, a cubic
Hermite bridge, and an exponential approach to white that is still
rising at white. The power roll-off it replaces reached white too early
(254.5 at input 200 where the reference has 253), so the lowered curve,
its inverse, stopped at 254 -> 191 instead of 214.

The measured -150 table is the inverse of the +150 one once the rounding
plateaus are read at their middle, so lowering stays the inverse of
raising. Both ramps now match within a level, and settings up to +/-110
are unchanged.

Fixes #14348
2026-11-21 16:34:02 +01:00
hnoerenberg 1e30578f0d Merge upstream/main into fix/curves-composite-rounding-14446
# Conflicts:
#	crates/compose/src/adjust.rs
2026-11-21 16:28:00 +01:00
Mex ba53b47048 Use the standard divisibility check in the bevel fixture 2026-11-21 10:54:15 +01:00
Mex f0a1b7c9c3 Tests: cut duplicate bevel thread cases (#15935) 2026-11-21 10:39:20 +01:00
Higgs32584andClaude Opus 5.5 3356714009 Merge upstream main into fix/8047-channel-mixer-cmyk
Resolve the conflict in crates/engine/src/adjust_params.rs: keep this
branch's generic mixer_row (RGB rows of 4, ink rows of 5) and main's
rounding to whole percentages before clamping (#14414).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-20 18:57:10 -05:00
superplay2021 00d838bd66 Merge latest main and resolve Align Edges conflicts 2026-11-20 20:11:10 +02:00
hnoerenberg bfe30f7eb9 test(compose): keep main's Size 1 review test honest about this branch's fix
#14934's review test asserted the Size 1 inner shadow map stays empty and that
Anti-aliased does not move it. #14933 changes the first half of that: Size 1 now
gets the 1/4-1/2-1/4 taps, so the first pixel inside every edge darkens. The gate
#14934 added still holds - aa_shift excludes a width-1 blur - so the map must stay
identical with the flag on and off, and darkening must stay symmetric on all four
edges instead of the one-sided line an ungated offset would paint.
2026-11-20 18:36:14 +01:00
hnoerenberg a8f4d243be Merge upstream/main into fix/inner-shadow-size-one-14933
# Conflicts:
#	crates/compose/src/effects.rs
#	crates/gpu/src/fx/builders.rs
#	crates/gpu/src/fx/tests.rs
2026-11-20 18:26:55 +01:00
hnoerenberg e395331e0e Merge upstream/main into fix/outer-glow-range-one-14958
Conflict: crates/compose/src/effects.rs test-module list only (kept both sides: outer_glow_range_one_tests plus main's satin_invert_contour_tests). crates/compose/src/effects/paint.rs merged cleanly: main changed noise() and glow_map(), this branch's Range-1 exception sits in glow_lut(), no overlap.
2026-11-20 16:21:55 +01:00
David Mann 59147c730c Merge #15112 into the merge queue batch
fix(compose): honour Anti-aliased for the Inner Shadow map
2026-11-20 15:52:16 +01:00
David Mann 1a97ade598 Merge #15735 into the merge queue batch
fix(compose): draw a one-pixel Size 1 Inner Glow
2026-11-20 14:16:36 +01:00
David Mann 95af987938 Merge #15013 into the merge queue batch
Gradient Map: keep the gradient's lightness in Grayscale documents (#14698)
2026-11-20 14:16:34 +01:00
hnoerenberg 8b1af24cb8 Merge upstream/main into fix/inner-shadow-antialiased-14934 2026-11-20 14:14:18 +01:00
hnoerenberg 900e9bbd02 Merge upstream/main into fix/inner-shadow-size-one-14933
# Conflicts:
#	crates/compose/src/effects.rs
2026-11-20 10:37:46 +01:00
hnoerenberg 2a5c4041b4 Merge upstream/main into fix/curves-composite-rounding-14446 2026-11-20 09:16:26 +01:00
superplay2021 31de878f08 Merge latest main and resolve Align Edges conflicts 2026-11-20 04:44:04 +02:00
David Mann bb4dc343b3 Merge #15420 into the merge queue batch
fix(compose): fade split Blend If points over both ends in 8-bit documents (#14855)
2026-11-20 02:04:37 +01:00
David Mann 968d74adee Merge #15282 into the merge queue batch
Layer Style: Satin's Invert flips the result after the contour (#14981)
2026-11-20 02:04:36 +01:00
David Mann 210de55b1a Merge #15197 into the merge queue batch
fix(compose): scatter Outer Glow noise at the measured strength

# Conflicts:
#	crates/compose/src/effects.rs
2026-11-19 22:27:52 +01:00
David Mann 79cb23b131 Merge #15188 into the merge queue batch
fix(compose): scatter effect noise at the measured strength (inner shadow)
2026-11-19 22:27:51 +01:00