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]>
#12887 measured a second half of the rule the reference application holds: it refuses an Indexed pattern from another image, whose colours are not in the document's colour table, and paints only the one carrying that table. Tracking the source mode and not the table lets that case paint. Pin it exactly as it behaves now - the tile's red and green land in a document whose table holds neither - so the follow-up (#16642) is met with a test that says which way the behaviour has to go, and record the same thing where the field is documented: how a repeat definition of pixels already in the library picks its source, and that the PSD raw-block comparison now covers the new field. An index written before the source member still loads the whole pattern with no source, which the library test now strips the member to prove.
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.
- 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.
Develops a clipped Bayer frame unclamped and rebuilds the clipped
highlights with craft-develop's reconstruct_masked, so RAW Open matches
LightCraft before tone. Frames too large to rebuild within the memory
limit keep the clip and report a warning. Rebless the RAW Open baseline
corner pixels and Linux hashes.
Fixes#16494
Part of storytold/craft-libs#778
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]>
* raw,camera_raw: bump craft-develop to 7631ed550 and add explicit parity tests (#587)
* raw,camera_raw: cut over develop_sensor demosaic and camera_raw::develop to craft_develop (#587)
* raw,camera_raw: fix craft_develop field names and test imports (#587)
* camera_raw: fix clippy excessive_precision and unnecessary cast lints
* raw,camera_raw: use exact gaussian_taps for sharpening, silence camera_raw_gpu dead_code, update post-cutover pins
* raw,camera_raw: fix highlights sign, <0.3px sharpen noop, non-Bayer/fused parity, and gpu test ignores
* engine: update camera_raw_filter_legacy_baseline_pixels to post-cutover craft_develop baseline
* raw,camera_raw: early-exit noop sharpen, exact full desat, PAD=6 fused margin
* raw,camera_raw: guard <0.3px texture/clarity blur and route fused band demosaic through craft_develop
* io: update default RAW Open baseline pins for craft_develop::sensor::demosaic reflect borders
* io: add Windows libm FNV-1a hash pins for RAW Open baselines
* test(raw): pin pre-cutover Camera Raw SmartFilter and filter baseline (#587)
* test(format): avoid json! macro recursion limit in camera_raw_roundtrip (#587)
* test(format): wrap SmartSource::Embedded bytes in Arc (#587)
* test(engine): use select.deselect in camera_raw_baseline_pin (#587)
* test(raw): capture legacy RAW Open and Camera Raw Filter pixel baselines (#587)
* test(raw): lock Camera Raw Filter baseline pixels and capture RAW Open values (#587)
* test(io): lock legacy RAW Open baseline pixels (#587)
* test(io): capture RAW Open camera WB legacy baseline pixels (#587)
* test(io): lock RAW Open camera WB legacy baseline pixels (#587)
* Open luminance and data-channel EXRs as RGB 32-bit
A Y-only, Z-only or Y + A EXR opened as a Grayscale document tagged linear gray through File > Open (the band decoder) and File > Open EXR Parts. Every EXR now opens as RGB 32-bit tagged linear sRGB, as in the reference application: the gray band is expanded to R = G = B with its alpha kept, and exr_parts converts every part or group to RGBA. RGB files are unchanged. The whole-file decoder in flat.rs (the bytes import and File > Open's fallback for a Z-only file) still opens gray as Grayscale and is left for a follow-up; an ignored test records it. Fixes#14069.
* Cover a Z-only EXR through File > Open
The band decoder reads a Z-only scanline EXR, so File > Open of one is covered by the passing test; only the bytes import through flat.rs stays an open point for #14069.
---------
Co-authored-by: qvest-ssels <[email protected]>
photocraft-paint's BrushSettings::tip is a Tracked<TipShape>; tools.setBrush keeps its revision when the new brush's
tip equals the old one. The options bar's field takes the presets, the tip and a BrushFace (size, hardness, angle,
roundness) as props instead of the whole brush, so an Opacity or Flow write replays it. Trial:
brush_settle_trials.
custom_domain_lookup_warns_and_round_trips_verbatim crossed 3 LUT domain
spellings with 6 PSD/PSB x depth containers (18 open/save chains). The
spelling only decides read_lookup's default-domain check; after that the
block is raw bytes whose stored lengths are all multiples of four, so no
spelling reaches a different container path. Each of the 6 containers now
takes the spellings in turn: every container and every spelling still runs
the whole open, native round trip and PSD/PSB re-save chain, with the same
assertions. adjust_map's unit tests still parse every spelling.
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]>
craft-libs next's hayro resolves degenerate subpaths before stroking
(ISO 32000-2 8.5.3.2: only round caps paint them), so for butt caps the
zero-length subpath no longer reaches the importer and the page stays
editable. The test now checks that: no warning, one shape with only the
visible line, its dashes kept. The guard in push_shape stays for paths
that still carry such a subpath.
next now has storytold/craft-libs#2550 (the default agent folder and the
agent_folders answer), #2612 (snap targets reach past their spans), #2631
(scroll bar arrows take no keyboard focus) and #2634 (Enter in the hex
field confirms).
- next vendors vello_common and vello_cpu for hayro; the patch section
follows it.
- craft_pdf::raster::Options gained max_coverage; the PDF importer keeps
craft-pdf's default (None).
- storytold/craft-libs#2363 gates a component's story-suite registration
on its crate's own `suite` feature and emits it ungated without one,
which needs craft's test kit in every build. ui-egui declares `suite`
(off): PhotoCraft runs no craft story suite.
The real-file corpus tests the Linux gate runs took up to 394 s each (the psd-tools mutation
sweep), 780 test-s together. Each now walks a fixed sample chosen for coverage (photocraft-testkit
`corpus`: every colour mode and depth, PSD and PSB, the block kinds outside the large files, each
oracle kind, smart objects, vector blocks, type) and stays under a second. PHOTOCRAFT_FULL_SWEEP=1,
the switch the testkit sweeps already read, takes every file; the nightly run sets it.
- Oracles keep floors for the sample next to the full floors.
- The mutation sweep cuts and corrupts each sampled file 12 times instead of 31.
- The layered TIFF test takes the psd-tools sample.
- The smart-object test imports only files with a placed-layer block (full sweep: 32 s to 5 s).
- The blend-mode tests import once and render only the compared cells.
- The 16.8 MP spot-channel file runs in full sweeps only; the generated files check the same reading.
- The #1606 special-shapes test is the affinity table's row for that file plus its warning check.
Part of #15711
main moved the command table out of crates/engine/src/cmd.rs into crates/engine/src/cmd/table/. cmd.rs takes main's version; this PR's Channel Mixer params doc (cyan/magenta/yellow/black ink outputs, monochrome unsupported for CMYK outputs) now lives on the channelMixer entry in cmd/table/image/adjustments.rs.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The palette PNG path wrote an Indexed Color document without
interlacing and said nothing; the band-wise PNG path warns when it turns
interlacing off. The palette path now adds the same kind of warning.
Co-Authored-By: Claude Opus 5.5 <[email protected]>