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.
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).
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.
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.
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]>
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.
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
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().
- 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.
- 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.
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.
#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]>
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]>
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
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]>
#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.
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.