1338 Commits
Author SHA1 Message Date
yoriswind 0cafa5d862 Use the measured Smooth transparency curve on layer masks 2026-12-01 03:00:58 -08:00
David MannandClaude Opus 5.5 1e50d2a0c4 Batch fix-up: translucent Smooth gradients save as drawn (#13855, CodeRabbit on #18551)
The colour-alpha check compared the read-back opacity with the stops'
alpha read linearly, but Smooth (and every baked gradient) renders the
nearest stop's alpha, and the opacity bake maps Smooth to Classic. It now
compares the read-back opacity with the alpha `bake_interpolation`
renders, so a Smooth gradient with translucent colours falls back to its
render stops. The save test adds Smooth and plain Classic.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 04:56:29 +01:00
David MannandClaude Opus 5.5 da0c334bb4 Batch fix-up: translucent stop colours under Linear or Perceptual save as drawn (#13855, CodeRabbit on #18551)
Without opacity stops of its own, a kept gradient's colour alpha was
written as opacity stops under the kept method; Linear and Perceptual bake
those on the next read (0.25 came back near 0.14). The record now counts
as matching only when the method and Smoothness give that alpha back, so
other gradients are saved as their render stops. The save test covers
Classic, Linear and Perceptual.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 04:32:45 +01:00
David MannandClaude Opus 5.5 a46bc09a93 Batch fix-up: retained gradients keep colour-stop alpha on save (#13855, CodeRabbit on #18551)
A saved stop colour carries no alpha, so a kept gradient with translucent
stop colours and no opacity stops was written opaque. The writer now puts
the colour alpha into the opacity stops in that case.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 03:47:15 +01:00
David MannandClaude Opus 5.5 921a6252eb Batch fix-up: a kept gradient without opacity stops of its own no longer matches translucent render opacity (#13855, CodeRabbit on #18551)
A Gradient Overlay given a translucent ramp after import was saved with
that ramp under the kept method, so the next read baked it again into a
different curve. Such a record is now stale and the writer saves the
render stops.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-12-01 03:47:15 +01:00
David Mann 03934fd0d9 Merge PR #13855: Gradient Fill layers and Gradient Overlay keep Photoshop's gradient 2026-11-30 23:55:19 +01:00
David MannandClaude Opus 5.5 800e3ddf66 Color Lookup layer Properties: radio rows for 3DLUT File, Abstract and Device Link, a Dither checkbox and the .cube orders (#18364)
The panel lays out as the reference application's: three radio rows with their dropdowns, the Dither
checkbox, and Data Order / Table Order radio pairs while a .cube is the LUT. The layer keeps the orders its
.cube was read in (LutSource), and an edit naming only an order reads the kept file again in the new
orders. The Abstract and Device Link rows ask for an ICC profile and say that applying one is not supported
yet (#14428), or that the file is the wrong kind of profile; the layer keeps its LUT.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 20:40:05 +01:00
David MannandClaude Opus 5.5 c92a017a23 Split the psd-tools mutation sweep into four parts (#18259)
The full sweep ran as one test and took 573-600 s on the nightly CI
runner, past nextest's 600 s limit on four of the last five nights,
which kept the nightly from being signed and published. Each part now
takes every fourth file with the same cuts and seeds, so every file
still gets the same variants, and fails if it got no file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-30 11:15:38 +01:00
David Mann ca09020a6c Merge #16653 into the merge queue batch
Layers to Files: Include ICC Profile checkbox and iccProfile param
2026-11-27 12:08:37 +01:00
qvest-ssels f4fe8e0bc1 Merge main into fix/gradient-fill-overlay-source-13557
# Conflicts:
#	crates/engine-core/src/cmd/convert_gradient_tests.rs
#	crates/engine-core/src/cmd/gradient_fill_cmds/source.rs
2026-11-27 11:12:56 +01:00
qvest-ssels 13a3c3acaa Leave the profile out of an Indexed PSD when Include ICC Profile is off
An Indexed Color document is written over its colour table by palette_map, which adds its RGB profile
(resource 1039) and returned before the embed_icc check, so Layers to Files with Include ICC Profile off
still wrote the profile into an Indexed document's PSD or PSB (#13973). That path now drops the resource
when embed_icc is off. Indexed PNG, BMP and GIF never carry a profile, and its JPEG and flat and layered
TIFF already followed the setting; the new test covers them too.
2026-11-25 20:59:00 +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 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
qvest-ssels 8f73a64324 Keep a document's profile for its colours when Include ICC Profile is off
With iccProfile false, Layers to Files cleared each layer file's document
profile, and the compositor reads a CMYK document's pixels through that
profile, so a CMYK document with its own profile exported to PNG with
different colours. The option now only leaves the profile out of the file
(SaveOpts::embed_icc), and the PSD writer (and the layered TIFF it feeds)
honours embed_icc like the PNG, JPEG and TIFF encoders do. #13973
2026-11-25 07:53:30 +01:00
David Mann 0aaf8ecfba Merge #15421 into the merge queue batch
Tests: wait for the other thread's state instead of a fixed sleep (#15379)
2026-11-25 00:57:21 +01:00
FredApps e56522780f Merge pull request #16532 from FredApps/fix/16494-highlight-rebuild
raw: rebuild sensor-clipped highlights instead of clipping after white balance
2026-11-24 18:44:40 +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 ca431fde00 test(tools): pin the Indexed pattern row this change lets go, and name its follow-up
#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.
2026-11-24 12:21:44 +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
FredApps b8726d6e22 raw: rebless the Windows RAW Open baseline hashes from hosted CI
Values from windows / test 4/6 of CI run 45325257093 (MSVC libm).

Part of storytold/craft-libs#778
2026-11-24 11:55:52 +07:00
FredApps 9244d9494e Merge remote-tracking branch 'origin/main' into fix/16494-highlight-rebuild 2026-11-24 11:14:46 +07: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
FredApps a8d463fabc raw: rebuild sensor-clipped highlights instead of clipping after white balance
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
2026-11-23 15:13:08 +01:00
ljkx a306a440cf Merge remote-tracking branch 'origin/main' into tests-condition-waits
# Conflicts:
#	crates/ui-egui/tests/it/gpu_device_loss.rs
2026-11-23 03:05:29 +01:00
David Mann 0cf81b45b5 Merge #8222 into the merge queue batch
Channel Mixer in CMYK documents mixes cyan, magenta, yellow and black (#8047)
2026-11-23 01:57:59 +01:00
Terra854andFredApps 6133bc3e4c io: use the shared PSD signature check (#16314)
Co-authored-by: FredApps <[email protected]>
2026-11-23 04:25:19 +07: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
aiongg cf2e416e31 Merge pull request #15914 from aiongg/ci-pin-toolchain
ci: pin Rust, stop cache evictions, corpus tests in the gate, fewer tests per PR
2026-11-22 12:03:37 -05:00
Dylan M. Taylor 65fc546bba raw, camera_raw: adopt craft-develop 7631ed550 and add explicit parity tests (#587) (#16393)
* 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
2026-11-22 10:36:03 -05:00
aiongg 3e05a3747b Merge remote-tracking branch 'upstream/main' into HEAD
# Conflicts:
#	.github/workflows/ci.yml
2026-11-22 15:29:46 +00:00
David Mann acc29380b1 Merge PR #16111: Custom-domain lookup test: each container takes one domain spelling (#15936) 2026-11-22 13:24:35 +01:00
David Mann 71495f89e5 Merge remote-tracking branch 'origin/main' into HEAD 2026-11-22 12:23:08 +01:00
aiongg 44ac69dede Merge upstream/main into ci-pin-toolchain; gate runs when platforms fails, cold cache clear keeps newer entries, panic_hunt timeout 2026-11-22 05:59:39 +00:00
Dylan M. Taylor f3f382697f test(raw): pin pre-cutover Camera Raw SmartFilter and filter baseline (#587) (#16028)
* 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)
2026-11-21 19:59:28 -05:00
David Mann 662feb6155 Merge PR #15844: fix(io): warn when OpenRaster drops layer blending settings 2026-11-22 00:28:22 +01:00
qvest-ssels 89dc118be8 Merge remote-tracking branch 'origin/main' into merge-13855-tmp
# Conflicts:
#	crates/doc/src/effects.rs
2026-11-22 00:04:57 +01:00
FredApps b95aa9292b Test Camera Raw exposure field presence across PSD reopen (#16334) 2026-11-22 05:52:31 +07:00
superplay2021 e1ba70a49b Merge latest main and fix Align Edges test compilation 2026-11-21 22:31:23 +02:00
David Mann 5374d1ca6d Merge remote-tracking branch 'origin/main' into pr-14292 2026-11-21 19:34:43 +01:00
Stefan S.andqvest-ssels 8aee047609 Open luminance and data-channel EXRs as RGB 32-bit (#16149)
* 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]>
2026-11-21 13:00:37 -05:00
FredAppsandFredApps 1f86f4bacf io: cover Camera Raw settings through PSD save and reopen (#16218)
Co-authored-by: FredApps <[email protected]>
2026-11-22 00:17:28 +07:00
David Mann 1af7ecaeab Merge remote-tracking branch 'origin/main' into pr-14292 2026-11-21 17:29:26 +01:00
aiongg a8f21a383d Brush tip is Tracked: the Brush Preset field runs only for the presets, the tip and the values it shows
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.
2026-11-21 14:07:15 +00:00
RickiNano 76c42a4808 Custom-domain lookup test: each container takes one domain spelling (#15936)
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.
2026-11-21 11:38:34 +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
David Mann f1c56c2db7 PDF editable import: a dashed zero-length subpath with butt caps paints nothing
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.
2026-11-20 23:49:48 +01:00
David Mann 3bd0223b13 Pin craft-libs next at 50e00dd49 with the default agent folder
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.
2026-11-20 22:47:44 +01:00