Commit Graph
11425 Commits
Author SHA1 Message Date
09d079278e fix(video): retain original footage for Restore Frame and Show Altered Video (#3192)
* fix(video): retain original footage for restore and comparison (#3059, #3060)

* Clamp original-frame inserts to the original stack; cargo fmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 05:02:29 -04:00
mighty-programmer c5683fd436 Merge new upstream font preferences and regenerate model scorecard 2026-10-11 11:58:14 +03:00
SBaksa 0634146383 Flatten Image, Stamp Visible and Copy Merged keep a CMYK document's inks
flatten_to_surface (Flatten Image, Merge/Stamp Visible, Copy Merged)
composited a CMYK document in RGB and converted it back, turning K-only
black into four-colour black (K100 became C18 M11 Y12 K91) and shifting
other inks. Documents whose layers mix on their ink values are now
flattened from that composite (over white paper, no ink, for Flatten
Image); others are converted back through the document's own profile,
the one their layers were read through, rather than the built-in one.
2026-10-11 19:58:03 +11:00
SBaksa d500c0361c PSD export: CMYK merged image mixed on ink values
The merged image of a CMYK PSD (what other applications show and
print) comes from the ink composite whenever the document's layers mix
on their ink values, so K-only black stays K-only there as in TIFF and
JPEG exports. Other documents keep the RGB composite converted through
the document's profile.
2026-10-11 19:58:03 +11:00
SBaksa 6ded412767 CMYK compositing: layer effects and knockouts ink by ink
CMYK documents whose layers carry effects (drop and inner shadows,
glows, strokes, colour and gradient overlays, satin, bevel and emboss)
or knockouts now composite on their ink values too. The RGB compositor
runs on two stand-in documents whose channels hold the brightness of
cyan, magenta and yellow, then of black: everything allowed there works
channel by channel (checked by rendering random effect stacks with the
inks in different channels), so the result is each ink's own. Fill
layers enter the stand-ins as the compositor renders them in CMYK
(solid colours at the document's depth, gradients as its CMYK ramp), so
both routes give the same inks. Pattern paints, bevel textures, effect
modes that mix channels, Blend If and 32-bit documents still composite
in RGB and convert back through the profile.

Adds cmyk::render_display, the ink composite shown through the
document's profile, for a canvas to draw.
2026-10-11 19:58:03 +11:00
vangel76andClaude Opus 5.5 96dd1956cc Merge upstream/main into fix/vp-stamp-tearoff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 10:56:33 +02:00
Skyfuller1303 ce8915f2ac Merge latest main and refresh generated preference audit 2026-10-11 10:55:43 +02:00
Reynold HuandBrandon Thomas 67e3d9be9f feat(ui): Font Preview Size drives the font menu samples (#204) (#2668)
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-11 04:52:17 -04:00
mighty-programmer 650b57bcf7 Merge latest upstream and reconcile optional-model lockfile 2026-10-11 11:51:22 +03:00
SBaksa 462d814c85 CMYK compositing: ink-by-ink adjustment layers on ink values
Invert, Posterize, and Levels and Curves recorded on the CMYK channels
now change a CMYK document's inks directly: each acts on the channel
brightness the document stores (the composite record on all four inks,
the black record on K only), mixed back by the layer's blend mode,
opacity and mask, then rounded to the document's levels as adjustment
layers are on the RGB compositor. Channels an adjustment leaves alone
keep their inks bit for bit. Clipped adjustments and layers clipped onto
an adjustment are covered. Adjustments that weigh the channels together
(Threshold, Hue/Saturation, Channel Mixer, ...) still composite in RGB
and convert back through the document profile.
2026-10-11 19:49:07 +11:00
SBaksa b6567bc375 CMYK compositing: per-channel blend modes on ink values
Every blend mode that works channel by channel (Multiply, Screen, the
burns and dodges, the lights, Difference, Exclusion, Subtract, Divide,
Dissolve and the rest) now mixes CMYK layers on their ink values: the
mode acts on each ink's brightness, as the RGB compositor does on each
channel, so K-only black under a Multiply layer stays K-only. For the
special eight, Fill below 100% is part of the blend as on the RGB
compositor (#2552). Modes that mix channels (Hue, Saturation, Color,
Luminosity, Darker/Lighter Color) still composite in RGB and convert
back through the document profile.

Normal mixing onto nothing gives the source's ink exactly: a rounding
error there (1 -> 0.99999994) was magnified by modes that jump at full
ink, Reflect turning no ink into full K.
2026-10-11 19:49:07 +11:00
SBaksa 46c78f82fb CMYK compositing: type, shape, smart object and fill layers on their ink values
Stage 2 of mode-native CMYK compositing (#2220). Type, shape and smart
object layers are composited natively through their rendered pixels,
which are drawn in the document's model (a colour given in CMYK is drawn
with exactly those inks). Fill layers use the pixels they were rendered
to when they carry them (as PSDs supply them), and otherwise the
compositor's own CMYK rendering at the document's depth (solid colours
and gradient ramps, #2628).

Type layers mix their edges in the compositor's text gamma, on
brightness (1 - ink), so K-only type gains no cyan, magenta or yellow at
its edges; covered pixels, and channels both sides agree on, keep their
exact inks instead of taking the gamma round trip.

Still on the RGB compositor: pattern fills without rendered pixels, and
stroked shapes with visible clipped layers.
2026-10-11 19:49:07 +11:00
SBaksa 4af9f116e7 CMYK documents export as CMYK, mixing pixel layers on their ink values (#2220)
A CMYK document with more than one plain layer went through the RGB
compositor and was written to TIFF and JPEG as sRGB RGB. Flat export now
always writes a CMYK document as CMYK with its own profile:

- New compose::cmyk: a mode-native CMYK compositor for the stacks whose
  blending is the same in every colour model (Normal pixel layers with
  opacity, fill opacity, layer and vector masks; isolated and
  pass-through groups; clipping groups). Pixels are mixed on their ink
  values, so opaque pixels keep their exact inks (K-only black stays
  K-only). Tiles render in parallel on native targets.
- Any other stack is composited in RGB and converted back through the
  document's CMYK profile, as PSD export's merged image is, with a
  warning that ink values can differ.

TIFF keeps transparency (CMYK + alpha); JPEG is composited over blank
paper (no ink) and written as CMYK; RGB-only formats still convert to
sRGB through the profile.

Fixes #2220.
2026-10-11 19:49:06 +11:00
6cfed3a7dc fix(masks): bake feathered coverage when applying pixel masks (#3044) (#3191)
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 04:49:03 -04:00
azizr12 bb40b658da Update ar.tsv 2026-10-11 08:47:15 +00:00
Skyfuller1303 220a32eeb5 Merge main and regenerate gradient preference scorecard 2026-10-11 10:46:00 +02:00
Skyfuller1303 5ea4b21449 fix(ui): clarify native gradient icon preference label 2026-10-11 10:40:27 +02:00
e46f119e03 i18n test: scan past small test modules; translate what it was missing (#2660)
every_tl_literal_is_translated cut each source file at its first `#[cfg(test)] mod`, so a small
test module early in a file hid every tl!("…") after it. panels.rs has one around line 540,
which left most of the toolbar options, the Layers panel and the Properties panel unchecked:
112 literals were never scanned.

The scan now removes each test module on its own (brace counting; a #[cfg(test)] on a single
item still doesn't count), with a unit test for the helper.

The strings it now finds are translated: 69 in Russian (most of the Layers panel and toolbar
tooltips), and the crop, lasso, zoom and fill hints in cs, de, es, fr, id, it, ja, ko, pl, pt-br,
uk, zh-hans and zh-hant. Translations reuse each catalog's existing terms; a native review is
welcome.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-11 04:39:45 -04:00
01833cfac2 fix(actions): avoid replaying Browse script edits twice (#3190)
* fix(actions): avoid replaying Browse scripts twice (#3057)

* cargo fmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 04:38:07 -04:00
azizr12 9a94ef3a6b Update ar.tsv 2026-10-11 08:35:32 +00:00
IvanandClaude Opus 5.5 39904a27ce Docs: CI runs nextest, the craft-fonts tests have their own job
Comments and docs still said CI runs cargo test, that the craft-fonts tests run a second time in
the Linux job, and that CI's debuginfo matches the dev profile everywhere. development.md also
notes that test builds compile ui-egui unoptimized.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 11:32:35 +03:00
21326ded43 fix(vector): preserve scaled live-line thickness during endpoint edits (#3184)
* fix(vector): keep scaled live-line weight after editing endpoints (#3063)

* cargo fmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 04:31:47 -04:00
vangel76andClaude Opus 5.5 3d5d7f6b68 Merge upstream/main into fix/vp-stamp-tearoff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 10:31:06 +02:00
Reynold HuandBrandon Thomas 93f2ff835a feat(ui): Beep When Done plays the platform beep for finished jobs (#204) (#2658)
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-11 04:29:59 -04:00
Skyfuller1303 e30cc7f172 feat(ui): make PhotoCraft gradient style icons selectable 2026-10-11 10:29:54 +02:00
azizr12 897b8132a0 Update ar.tsv 2026-10-11 08:29:29 +00:00
a9aabcdfde fix(vector): pivot explicit path transforms on target layer (#3062) (#3183)
* fix(vector): pivot explicit path transforms on target layer (#3062)

* cargo fmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 04:23:08 -04:00
azizr12 acea084b8f Update ar.tsv 2026-10-11 08:21:10 +00:00
233237e9dc Reject bad params in the control channel's synthetic input methods (#2449) (#2656)
ui.pointer, ui.click/ui.move, ui.key and ui.screenshot read every value
with as_f64/as_bool/as_str and fell back to a default on any other type,
and an unknown button or event kind fell through to a left click or a
move. A typo such as "button":"ritgh" ran a different action and still
replied ok.

Each method now validates its whole request before acting, like ui.set:
unknown fields (top-level, under modifiers, or in an event), wrong JSON
types, unknown button/kind/tool values (the error lists the accepted
ones) and out-of-range pressure, tilt and rotation return an error that
names the parameter, and nothing is queued or applied. Null fields still
mean omitted, and valid calls behave as before.

Co-authored-by: Fabio Lussi <198260595+itrycodinganditsbad@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-11 04:18:18 -04:00
f6dd0aa6f3 fix(io): preserve group fill opacity in OpenRaster exports (#3181)
* fix(io): preserve group fill opacity when exporting OpenRaster (#3048)

* cargo fmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 04:16:30 -04:00
azizr12 d100798ef8 Merge branch 'main' of https://github.com/azizr12/photocraft 2026-10-11 08:14:06 +00:00
azizr12 95496b4991 Merge branch 'storytold:main' into main 2026-10-11 09:13:17 +01:00
458870dadc Auto-Blend Stack Images: fuse the merged layer per pyramid level by region energy, with halo control (#2044)
* Auto-Align Layers: register focus and exposure brackets by intensity when there is nothing to match

Feature matching fails outright on layers that nearly coincide (a focus bracket: sub-pixel shifts, up to a few percent of scale from focus breathing, much of every frame defocused). `photocraft_algo::direct` registers the target to the reference coarse-to-fine on a Gaussian pyramid of the luminance, the cost the mean-removed RMS of the warped difference over the pixels both cover, by a bounded Nelder-Mead search with a per-level schedule; the pose is a similarity about the centre, affine or projective per the projection, and resolution independent, so the search stops short of full resolution. `edit.autoAlignLayers` gets `registration`: auto (features, then intensity when nothing matches), features, intensity; layers register outward from the reference, each to the previous one aligned.

Closes #2064.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Intensity registration: reject a no-fit, search on coarsened planes

Review follow-up on #2065:
- `direct::cost` also returns the correlation of the reference with the
  warped target over the overlap; `Registration.correlation` carries it.
  Unlike the mean-removed RMS it is exposure independent, so it tells a
  bracket (near 1) from unrelated pictures (near 0).
- `register_direct` fails with the existing "couldn't find enough matching
  detail" error when a layer's best pose overlaps its neighbour by less than
  a quarter of the plane or correlates below 0.5, instead of placing it at
  whatever pose the search box ended at.
- The luminance planes are built at the search scale (`luma_alpha` with the
  reduction factor, ≤ 2048 px across) and the warp of each registered layer
  runs there too; the pose is resolution independent and its matrix at full
  resolution places the layer. Nothing full-resolution is held.
- The reference index is checked once with `get`; no unclamped indexing.
- Tests: correlation at an exposure step, for unrelated textures and a flat
  plane; the engine rejects unrelated layers and a mostly empty one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Auto-Blend Stack Images: fuse the merged layer per pyramid level by region energy, with halo control

The merged layer of Edit › Auto-Blend Layers › Stack Images was the per-pixel masks blended with a multiresolution spline, so a wrong pick in the mask reached every scale. `pyramid::fuse_stack` fuses the layers on the Laplacian pyramid instead: per coefficient the layer with the largest region energy of its luminance band wins (Adelson et al. 1984's multifocus composite with Wang & Chang 2011's rules), the residual follows local deviation + entropy, and with halo control the levels coarser than the guide are weighed by the guide's energy so a bright object's defocused glow stays out. `haloControl` (0..8, default 2) on `edit.autoBlendLayers`; the masks and the panorama method are unchanged.

Closes #2043.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-11 04:13:11 -04:00
azizr12 b4fe3a651e Update ar.tsv 2026-10-11 08:12:34 +00:00
5c9d9116bc fix(layers): select Shift ranges in visible panel row order (#3041) (#3180)
* fix(layers): select Shift ranges in visible panel row order (#3041)

* cargo fmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 04:12:27 -04:00
Fabian GhenofandClaude Opus 5.5 c17cc118f5 Moving a shape keeps its rendering: Artboards to Files matches Photoshop
translate_vectors re-rendered a shape layer on every move. For a shape from a
PSD that replaced Photoshop's anti-aliasing with PhotoCraft's, so Artboards to
Files (which moves each board to the origin), the Move tool, nudges, layer
comps and moving artboards changed how imported shapes look.

A whole-pixel move now shifts the rendered pixels, through one shift_shape
helper shared with the Move tool's live preview (layer_multi_cmds::
shift_shown), which already did this. The render is cut at the canvas, so a
shape reaching past it still renders again, as does a fractional move; the
path moves either way, and fit_canvas still re-renders shapes when an
artboard move grows the canvas (#2389).

Measured on a Steam store asset template with #3218 (the same fix for type):
the "How to use" artboard has no pixel off by more than 2 levels from
Photoshop's own composite; before, both its shapes differed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 11:11:48 +03:00
Lyraedan f11380d5bd Double-clicking a mask thumbnail in the Layers panel now opens that mask's settings (#2654)
* Double-click a layer mask thumbnail to open its settings

Double-clicking a mask thumbnail in the Layers panel now opens that mask's settings in the Properties panel, matching Photoshop. When the Preferences ▸ Tools ▸ "Double Click Layer Mask Launches Select and Mask" option is on (the current default) a pixel mask still launches Select and Mask, exactly as before; with it off, double-clicking targets the mask and opens its Properties (Density/Feather). Vector masks now behave consistently too: double-clicking one targets it and opens a new Vector Mask Properties section.

* Fixed syntax issue from merge

* Fixed missing closed brace in ui tests
2026-10-11 04:11:35 -04:00
ragtuxandClaude Fable 5.1 ec60f43b5b Auto-Align Layers: register focus and exposure brackets by intensity when there is nothing to match (#2065)
* Auto-Align Layers: register focus and exposure brackets by intensity when there is nothing to match

Feature matching fails outright on layers that nearly coincide (a focus bracket: sub-pixel shifts, up to a few percent of scale from focus breathing, much of every frame defocused). `photocraft_algo::direct` registers the target to the reference coarse-to-fine on a Gaussian pyramid of the luminance, the cost the mean-removed RMS of the warped difference over the pixels both cover, by a bounded Nelder-Mead search with a per-level schedule; the pose is a similarity about the centre, affine or projective per the projection, and resolution independent, so the search stops short of full resolution. `edit.autoAlignLayers` gets `registration`: auto (features, then intensity when nothing matches), features, intensity; layers register outward from the reference, each to the previous one aligned.

Closes #2064.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Intensity registration: reject a no-fit, search on coarsened planes

Review follow-up on #2065:
- `direct::cost` also returns the correlation of the reference with the
  warped target over the overlap; `Registration.correlation` carries it.
  Unlike the mean-removed RMS it is exposure independent, so it tells a
  bracket (near 1) from unrelated pictures (near 0).
- `register_direct` fails with the existing "couldn't find enough matching
  detail" error when a layer's best pose overlaps its neighbour by less than
  a quarter of the plane or correlates below 0.5, instead of placing it at
  whatever pose the search box ended at.
- The luminance planes are built at the search scale (`luma_alpha` with the
  reduction factor, ≤ 2048 px across) and the warp of each registered layer
  runs there too; the pose is resolution independent and its matrix at full
  resolution places the layer. Nothing full-resolution is held.
- The reference index is checked once with `get`; no unclamped indexing.
- Tests: correlation at an exposure step, for unrelated textures and a flat
  plane; the engine rejects unrelated layers and a mostly empty one.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 04:02:26 -04:00
Nigel Ihza Firdausy 37929405df fix(history): restore empty layer target on undo and redo (#3042) (#3179) 2026-10-11 04:02:23 -04:00
Skyfuller1303 c41704fdb1 fix(ui): match toolbar gradient style previews to Properties 2026-10-11 10:00:40 +02:00
Reynold HuandBrandon Thomas fa2fe1c90f feat(ui): the brush HUD honors Vary Round Brush Hardness and Brush Preview Color (#204) (#2640)
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-11 03:59:04 -04:00
abc2cb 338304e712 Merge upstream main into Layers Panel PR, preserving docking, layer moves and localized options 2026-10-11 10:54:25 +03:00
64ec252dbe fix(layers): remap linked-layer groups when copying between documents (#3178)
* fix(layers): remap link groups when copying across documents (#3045)

* cargo fmt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 03:48:33 -04:00
cf83e05821 fix(psd): Improve interoperability and decoding (#1955)
* fix(psd): Align global tagged blocks to four bytes

Use four-byte defaults for global blocks and streamed layer information.
Read global payloads without full copies while preserving block order,
explicit padding and the first layer candidate. Keep two-byte layer
alignment; test canonical padding and lossless PSD/PSB parsing.

* fix(psd): Preserve transparent composite colours and precision

* fix(psd): Check ZIP integrity and bound layer previews

* fix(io): Use document CMYK profiles for PSD fill pixels

Generated fill pixels used the default CMYK separation even when the PSD
embedded a different profile. Scope layer export to the document colour
space so cached pixels and the composite use the same profile.

Check native cached samples against an explicit ICC transform at 8 and
16 bits.

* io: refuse an empty RGB composite before splitting it into planes

chunks_exact(0) panics; an empty decoded composite now returns an error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 03:46:52 -04:00
cfd12263af Rulers: keep tick marks and labels out of the origin corner (#2617)
* Rulers: clip tick marks and labels outside the origin corner

* Rulers test: set ViewXform's new aspect field after merging main

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 03:46:29 -04:00
Nigel Ihza Firdausy 3188866b25 fix(masks): retain off-canvas alpha in From Transparency (#3043) (#3177) 2026-10-11 03:43:18 -04:00
2785699464 fix(type): use the correct line at soft-wrap caret boundaries (#3174)
* fix(type): use the next visual line at shared wrap boundaries

At soft-wrap and forced-break character offsets, resolve the caret's visual line from the last matching line rather than the preceding one. Make line-edge navigation share that choice and add regression tests for wrapped, forced and paragraph breaks.

* test(type): use actual break characters in caret boundary regressions

* fix(type): preserve the visual line when hit testing a shared wrap offset

Keep caret index preference on the following line, but use pointer geometry for click-hit line identity at an adjacent line's end.

* Update the caret round-trip test for wrap-boundary lines; cargo fmt

The existing round-trip helper expected the first line containing a
shared soft-wrap offset; the caret now reports the following line, where
it is drawn and where hit testing lands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 03:37:27 -04:00
Reynold HuandBrandon Thomas de58a0a778 feat(ui): the Type units preference drives the type metric units (#204) (#2587)
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-11 03:37:06 -04:00
Ratul Paul 15a3ce86f0 Add intermediate UI scale presets between 100% and 125% 2026-10-11 13:32:17 +06:00
abc2cb 1515cafae4 fix(engine): retain Smart Filter coverage around blur edges 2026-10-11 10:31:23 +03:00