docs/content-aware-scale-performance.md records what changed, the
exactness contract (bit-identical wherever the energy stays a number;
NaN and infinities now deterministic), and interleaved before/after
timings on a 4-core VM: the carve of P28's 24 MP photo 2013 -> 556 ms,
the P28 row 3281 -> 1639 ms against its 3 s budget, smaller images
1.65-2.3x faster, peak memory unchanged or lower.
gaps.md G2 and target-app-parity.md get the dated measurement;
budgets.toml's P28 comment says the target is met. Its enforce flag and
the committed baseline stay as they are until the reference machine
reruns cargo xtask perf --update-baseline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LELc5BQzgV5dA7dxdMejkK
Keep the saved spacing while Off or toggling, and retain percentage limits
and tools.setBrush routing. Cover the shared header in all themes and add
disabled-input, value-retention and journal regressions. Addresses only the
Spacing header subsection of #3825.
Co-authored-by: GPT-6 <noreply@openai.com>
Smart filters PhotoCraft applied with Pinch, Polar Coordinates, Ripple,
Spherize, Twirl, Wave, ZigZag or Invert were dropped when saving a PSD ("this
filter has no PSD equivalent"), and the same filters in a Photoshop file opened
as kept-verbatim entries that didn't render. They are now mapped both ways in
`smart_map.rs`, with the keys, enum codes and key order Photoshop 27 writes
(checked against a Photoshop-saved file holding one smart object per filter):
- Pinch `Pnch` Amnt; Twirl `Twrl` Angl; Ripple `Rple` Amnt + RplS (Sml/Mdm/Lrg);
Spherize `Sphr` Amnt + SphM (Nrml/HrzO/VrtO); Polar Coordinates `Plr ` Cnvr
(RctP/PlrR); ZigZag `ZgZg` Amnt, NmbR, ZZTy (PndR/OtFr/ArnC);
- Wave `Wave` Wvtp, NmbG, WLMn/WLMx, AmMn/AmMx, SclH/SclV, UndA, RndS.
PhotoCraft's Wave has no Scale, so a Photoshop wave scaled off 100% stays
verbatim rather than lose it;
- Invert `Invr`: no `Fltr`, `hasoptions` true, like Photoshop.
Shear stays unmapped for now: Photoshop stores its curve on its own grid.
Tests: the Photoshop `Fltr` bytes read back as the PhotoCraft settings and are
rewritten with the same keys, values and order; a scaled Wave round-trips
unchanged; Invert's item; the new filters join modelled_filters_round_trip.
The verbatim-filter tests now use Crystallize and Shear.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the second half of the adversarial review:
- Correction to the previous commit: mapping energies that aren't
numbers to +inf also changes output where the original computed NaN
energies from NaN-free input (infinite samples at the border or next
to each other, overflowing differences). The original's choice there
went through NaN costs; keeping it would bring NaN back into the seam
search, whose sign and payload aren't consistent across builds and
wasm. So the contract is: bit-identical for every input whose energy
stays a number (all finite images without overflow), deterministic
everywhere else. infinite_samples_carve_deterministically pins it.
- The height pass resampled the raw protection map, so an infinite
value (or neighbours whose difference overflows) became NaN, which
protects nothing: a row protected with +inf was carved away while 1.0
kept it. Where the plain resample gives NaN, the map clamped to 0..=1
is resampled instead (resample_protection); every other value is
unchanged. infinite_protection_protects_in_both_passes failed before.
- Values past w x h x ch are ignored through both passes.
- Docs: row_costs is what recomputes pixels; the reduced-height search
cuts the work 8-12 times at 24 MP, not about four; bench_seam's hash
is FNV-style over 32-bit words. Carver::new reserves its index.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LELc5BQzgV5dA7dxdMejkK
Picks up main's rustfmt fix for rotate_view.rs and wheel_nav.rs, which
failed the Format step at 74cb2935.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts resolved:
- layer.new.layer: main's `position: above|below` (its Cmd/Ctrl-click New Layer) replaces this
branch's `below` flag, and `layer_place` still places the layer, so a layer added below
joins the open group or clip group it lands in. `layer.new.group` takes the same `position`
param, and the Layers panel's Cmd-click on New Group sends it.
- Paste keeps main's linked smart-object blocks and this branch's placement; Auto-Blend's new
Depth and Blended layers go through `layer_place` like its other new layers.
- dialogs.rs and menus.rs keep main's Channel Options / New Spot Channel dialogs next to the
New Group dialog; ui-parity.md keeps main's change list and rows next to this branch's.
- hu, tr and sr (complete catalogs on main) get "New Group…" and "New Group from Layers…".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NyBcWJNZ3eRotC5HNZuwge
Resolve conflicts in gradient_ui.rs, panels.rs and preset_panels.rs:
keep the pixel-snapped ramp (#4577) with the opaque-ramp checkerboard
skip, use main's gradient ramp icon (#4172) for the native Linear style
button, and keep the preset folder button labels on main's draggable
headers. Take main's docs/scorecard.md and regenerate it.
Translate the native gradient icon preference for hu, sr, tr and vi,
and make the half-pixel ramp test paint a translucent ramp so the
checkerboard it checks is still drawn.
Conflicts:
- edit_menu_cmds.rs: main's #4133 (Sample All Layers off unless the active layer has no pixels
in the window) now decides `sampleAllLayers` inside the workspace's fill plan; the job keeps
the plan-based fill, the spec keeps the workspace's parameters.
- lib.rs: both module lines (caf_ui, cam_preview).
- hu, tr, vi catalogs: both sides' rows. Dropped de's High/Low (main now has them) and hu's
older "Vanishing Point" row main reworded. Added the 15 workspace strings to sr.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
perf_scenarios needs the whole UI crate in release (about 25 min to
build on 4 cores) to time edit.contentAwareScale. This example times the
same command on the same synthetic 24 MP JPEG photo from the engine
alone (about 6 min), undoing between runs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LELc5BQzgV5dA7dxdMejkK
Pass the active tool to the section renderer and disable the complete
Wetness/Mix Transfer blocks when they do not apply, preserving saved settings.
Cover all themes/tools, disabled input, active edits and real tool-cache swaps
with three regressions, including exact tools.setBrush journal routing.
Addresses the Wetness/Mix tool-applicability subsection of #3825.
Co-authored-by: GPT-6 <noreply@openai.com>
Amiga IFF/ILBM (EA 85) artwork opens read-only: the FORM chunks BMHD,
CMAP and BODY, both the interleaved ILBM and planar PBM variants, 1-8
bitplanes through the palette (a grey ramp when there is none), masking
0/1/2, and both stored (0) and ByteRun1/PackBits (1) compression. Chunk
lengths and Run lengths are checked, so a malformed file errors rather
than panicking; other bit-plane counts return Unsupported. No writer, so
.iff/.lbm/.ilbm join the open filters and the format opens in Photoshop
parity's Amiga IFF row.
From an adversarial review of the Content-Aware Scale speed-up:
- resize_bilinear with zero channels panicked (chunk size 0) since the
previous commit; it, carve_with and carve_width_with now return early
when there are no pixels or channels, or fewer values than the size
says (sizes checked with checked_mul). carve with an empty width and
a height change, and a protection map shorter than the image (now
ignored), panicked before this series too.
- With NaN in the energy map, which seam was chosen depended on the NaN
payload, and that differed between builds. NaN samples now give the
highest energy and NaN protection protects nothing, so costs are never
NaN; outputs without NaN are unchanged (all pins match).
Tests: degenerate_inputs_do_not_panic and nan_payloads_do_not_steer_seams
(both failed before), proxy_rebuild_observes_cancellation (a cancel during
the tall-image rebuild), and NaN/inf cases in incremental_dp_matches_full_dp.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LELc5BQzgV5dA7dxdMejkK
Detect and exclude the subject from blur sampling while preserving selection, alpha, masks, and other layers in one undoable edit. Add the fifth preset and verify pixel behavior, failure handling, UI playback, and full-size performance.
Generated with Codex.
shape.create and shape.edit accept the full paint model for fill and
stroke: solid colours with alpha or a model colour, gradients with
opacity stops, midpoints, offset, dither and align, and patterns with
id, angle, link and phase. Malformed paint values are rejected before
the document changes. shape.info reports the same complete paint JSON.
Pattern paints resolve a document or library pattern and embed its tile
in the same undo step, and shape caches render with the document's
patterns. Copy/Paste Fill and Stroke keep a snapshot of the referenced
pattern so pasting still works after the source document is closed, and
refuse to overwrite a different pattern with the same id.
Refs #2496
Pattern fills on shape layers rendered transparent because the vector
renderer had no access to the document's pattern table. Add
Paint::Pattern, Paint::from_fill_with_patterns,
CompiledShape::with_patterns and render_shape_with_patterns, which
resolve a pattern by id or name and sample it in the document's colour
mode, for the fill and the stroke independently.
The compositor's fill/stroke split (used for clipped layers and interior
effects) now renders with the same patterns and colour mode on CPU and
GPU, and its cache key covers the referenced pattern tiles.
Refs #2496
Shape layers need to sample pattern tiles while rendering their fill and
stroke, and photocraft-vector sits below photocraft-compose. Move Tile,
Placement and pattern_rgba into photocraft_vector::pattern and re-export
them from compose so existing callers keep working.
The moved tile also guards against hostile input: non-finite sample
coordinates return transparent, wrapping no longer overflows on huge
coordinates, and a tile above 64 MiB of prepared pixels samples its COW
surface instead of allocating a second full buffer.
Refs #2496
Resolves vp_ui.rs: upstream's in-window undo history (EditHistory) now also steps through torn-off planes, the clone source and the stamp strokes (the old stroke-only Cmd+Z handler is gone). scorecard/tools.toml takes upstream's notes plus this branch's TOOL-214-14 row; docs/scorecard.md regenerated. i18n: dropped duplicate hu/ja keys from the union merge, added the two stamp strings to the new sr catalog.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Resolve filter_dialog.rs: main's Blur Gallery pin scaling for proxy
previews (#3801) moves into scale_preview_params, which this PR uses for
every preview, so pins also scale when Blur Gallery runs as a Smart
Filter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#4466 landed `{name}` / `{serial}` / `{date}` file naming templates and
`startingSerial` on main while this branch was open. The merge keeps that
contract on top of the branch's `batch::Naming`: `{serial}` pads to three
digits (`{serial:1..4}` explicit), `{date}` is the UTC `YYYY-MM-DD`, a
template without `{ext}` gets the output extension appended, `naming` must
be a string of at most 255 bytes, `startingSerial` is 1..4294967295 and the
serials of a run must stay within that, and the whole plan is checked before
anything is written (`plan_outputs`): no output may replace another input
before it is read. `file_cmds/batch_naming.rs` and `process_outputs` are
superseded; #4466's tests stay and pass. The Batch dialog starts with a blank
template (hint `{name}.{ext}`), `startingSerial` replaces `startSerial`
everywhere (engine, lens batch, CLI validation), docs/batch-naming.md
describes the merged tokens.
* fix(compose): a wide stroke effect keeps a round outer edge (#3646)
A stroke's outside distance came from the 5x5 chamfer, whose level sets are polygons: at a
245 px outside stroke the boundary wanders ~10 px into visible flat facets. Use the exact
Euclidean distance (edt_nearest, already used for glows and chiselled bevels) for the outer
edge; the inside edge and spread/choke keep the chamfer, whose sub-pixel edge seeding is
fitted to Photoshop at small offsets. A point source dilated by 60 px now stays within 0.5 px
of a circle (was 2.5 px).
Tests: a_wide_outside_stroke_is_round_not_a_polygon; stroke_edges_use_the_exact_euclidean_distance
(a 3 px outside stroke's (1,3) corner coverage is 0.838, the exact distance; it was 0.764).
Full photocraft-compose suite: 206 pass; fmt and clippy clean.
* fix(gpu): a wide stroke keeps its exact outer edge on the GPU (#3646)
1080008a fixed the CPU compositor's stroke outer edge to use the exact
Euclidean distance instead of the 5x5 chamfer, whose level sets are
polygons and facet a wide stroke. The GPU compositor builds the outer
stroke field from FieldKind::StrokeOutside, which still maps to the
chamfer, and the canvas is drawn on the GPU, so the fix did not reach the
app.
Add FieldKind::StrokeOutsideExact (dist_outside_by Euclidean) used only by
the stroke. The spread of drop shadows and softer outer glows keeps the
chamfer on purpose (fitted to Photoshop, #224), so StrokeOutside keeps its
meaning. StrokeOutsideVector is exact too, matching the CPU vector outline
path.
Tests: crates/gpu/src/fx.rs a_raster_stroke_uses_the_exact_outer_field
(stroke uses the exact field, shadow spread keeps the chamfer), and the
banded/whole field test covers the new kind.
* fix(stroke): a stroke keeps the chamfer narrow and the exact edge wide (#3646)
The exact Euclidean outer edge (#3646) fixed a wide stroke's faceting but
regressed Photoshop's own composites against the PSD flatten oracle: the
fitted 5 × 5 chamfer matches Photoshop at small offsets, and only at a large
outside width do its octagon facets show. Pick the metric by the stroke's
outside width instead: below `STROKE_CHAMFER_MAX` (20 px) keep the chamfer and
its sub-pixel edge seeding, at or above it use the exact Euclidean transform.
The measured chamfer deviation from a point source is 0.027 · r px — 0.48 px at
r = 18, the widest outside stroke any Photoshop oracle matches with the chamfer,
and 1.6 px at r = 60, where the boundary visibly facets. Half a pixel is reached
at r ≈ 19, so the switch sits at 20. Inside stroke edges keep the chamfer.
The CPU and GPU compositors pick the same field by the same width
(`stroke_outside_exact`); `FieldKind` gains `StrokeOutsideVectorChamfer` for a
narrow shape-layer outline, while the shadow / glow spread keeps its chamfer.
io corpus: 140 → 148 (floor 146) and psd-tools 231 → 237 (floor 236), both back
to main's counts with no file newly differing; a 60 px outside stroke stays
round (`a_wide_outside_stroke_is_round_not_a_polygon`).
A renderer's data window is its crop of the frame; the composition lives
on the whole display window (our MY27 renders: data 1782x1267 at
(1109,1100) inside a 4000x3000 stage). decode_deep now validates the
display window against the limits and reports it as stage + origin on
DeepImage; flatten pads the composed region to the stage at its offset
(transparent elsewhere) and tags the image with a DisplayWindowStage
warning. Files without a usable display window open as before.
Includes a cropped-deep generator and a stage/offset oracle test.
* fix(gpu): contain errors in unwatched compositor work
* test(gpu): gate recovery fixtures on format capabilities
---------
Co-authored-by: haranishi <223786623+haranishi@users.noreply.github.com>
A flat TIFF dropped EXIF on export ("EXIF not supported") and ignored it
on import. TIFF is EXIF's own container: IFD0 points to the Exif (34665)
and GPS (34853) directories and holds the descriptive tags.
- Export: the EXIF block's Exif and GPS directories are written as
directories outside the page chain, IFD0 points to them, and IFD0's
descriptive tags (ImageDescription, Make, Model, Software, DateTime,
Artist, Copyright) are added unless the text metadata already wrote
them. Values are copied as bytes, reordered to the file's byte order,
so unknown tags survive.
- Import: a classic TIFF with an Exif or GPS directory gets an EXIF
block built from them and IFD0's descriptive tags.
- TIFF's format caps now include EXIF. Layered TIFFs keep EXIF as
resource 1058 as before (read back unchanged); the layered importer
already preferred the TIFF's own EXIF when there is one.
exiftool and Photoshop 2025 read the Exif and GPS tags of such a TIFF.
Fixes#4875
Drag out of the rulers' upper-left corner to move the zero point: cross hairs mark where it
lands, Shift snaps it to the ruler ticks and View > Snap To targets apply otherwise; dropping it
back on the corner cancels. Double-clicking the corner puts it back at the image's top-left.
The rulers then read 0 at the zero point (negative left of and above it) and the Info panel's
X/Y measure from it.
The zero point is a document field (`ruler_origin`, document pixels), saved in .pcraft with
`#[serde(default)]` so older files open at the top-left. It is set by two undoable engine
commands, `view.setRulerOrigin {x, y}` and `view.resetRulerOrigin`, so agents can drive it.
It is not written to PSD: the public PSD spec documents no resource for it.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The compressed RW2 layouts of earlier Lumix bodies (e.g. the DMC-GX7)
decode at full sensor resolution instead of falling back to the camera's
embedded JPEG preview. The layout was established by observation of
sample files (fixed 16 bytes per 14 pixels, predictor groups with
per-parity predictors, page-permuted downward bit order); the black
level of these files reads 15 counts low.
Adds round-trip tests through a mirrored synthetic encoder, cursor and
predictor-group unit vectors, and updates the support matrix.
Co-authored-by: Gotya-OFFCIAL <339410022+Gotya-OFFCIAL@users.noreply.github.com>