photocraft/crates
EthanSuquet fb924dad16
Shapes: a hairline vector stroke no longer darkens the shape's edge pixels (#397)
* Shapes: a hairline vector stroke no longer darkens the shape's edge pixels

A stroked shape with layer effects (or clipped layers) is drawn as our
fill plus a vector stroke fitted to Photoshop's own pixels: where those
pixels reach past our fill, the stroke takes the alpha the fill doesn't
explain, `(pixels - fill) / (1 - fill)`. It kept our stroke's colour for
that alpha. When Photoshop's fill covers more of an edge pixel than ours
(shapes snapped to whole pixels with Align Edges, our path a fraction off
the grid), the fitted alpha is mostly Photoshop's fill, so a 0.25 px grey
border on a white card was painted as a solid grey line: the edge came out
at the stroke's full colour (122) instead of Photoshop's 220.

The fitted stroke now takes the colour that, drawn Normal over our fill,
gives back Photoshop's pixel (un-compositing the premultiplied colour),
and keeps our colour only where the fitted alpha is negligible. Where
Photoshop's pixels agree with our fill this is our stroke's colour, as
before.

Test: hairline_vector_stroke_keeps_photoshops_edge_pixel_colour (edge
pixel 0.478 before, 0.86 after). The compose, gpu, io and engine tests
and the psd/io/engine corpus tests pass.

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

* Shapes: neutral wording in the hairline-stroke fix; test it at 8, 16 and 32 bits

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

---------

Co-authored-by: EthanSuquet <292885762+EthanSuquet@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
Co-authored-by: Tanish Manku <tmanku.dev@gmail.com>
2026-10-07 13:50:09 -07:00
..
algo Filter › Render › Relight: redirect a photo's lighting (#735) 2026-10-07 16:45:57 -04:00
automation fix(automation): downscale bridge screenshots before PNG budget (#753) 2026-10-07 13:49:50 -07:00
cms fix(cms): check LUT declared sizes before arithmetic (#725) 2026-10-07 15:41:09 -04:00
codecs fix(codecs): correct TIFF polarity and BigTIFF orientation (#746) 2026-10-07 13:50:04 -07:00
color fix(color): match Photoshop blend corner values (#699) 2026-10-07 16:00:27 -04:00
compose Shapes: a hairline vector stroke no longer darkens the shape's edge pixels (#397) 2026-10-07 13:50:09 -07:00
doc Fix document run and ID overflow (#684, #685) (#749) 2026-10-07 13:49:46 -07:00
engine Fix document run and ID overflow (#684, #685) (#749) 2026-10-07 13:49:46 -07:00
format Fix document run and ID overflow (#684, #685) (#749) 2026-10-07 13:49:46 -07:00
geom fix(geom): saturate Rect::translate and inflate on i32 overflow (#159) 2026-10-05 04:14:40 -04:00
gpu 32-bit documents: Levels don't clip the input and output ranges (#403) 2026-10-07 06:53:56 -04:00
heif Open HEIC/HEIF photos (#355) (#372) 2026-10-07 10:20:40 -04:00
io Fix document run and ID overflow (#684, #685) (#749) 2026-10-07 13:49:46 -07:00
ops History: tool and preset names, Frame from Layers as one step, undo/redo restore the targeted layers (#513, #528, #446, #496, #495) (#551) 2026-10-07 13:54:10 +07:00
paint Start context-menu parity across canvas, paths, and document tabs (#556) 2026-10-07 07:45:26 -04:00
plugins Sandboxed WebAssembly plug-ins: photocraft-plugins (wasmi), plugin.* commands, Filter › Plug-ins (#67) 2026-10-04 16:08:28 -04:00
psd PSD: read smart-filter masks (FEid) with one section per smart object (#396) 2026-10-07 07:40:10 -04:00
raster Background jobs: engine job API, progress and cancel (part of #210) (#289) 2026-10-06 15:41:38 -04:00
raw CR2: measure the colour filter row phase instead of assuming RGGB (#193) (#244) (#244) 2026-10-05 11:15:58 -04:00
tablet Stylus pressure, tilt, rotation and eraser on macOS and X11 (#255) (#255) 2026-10-05 17:47:59 -04:00
testkit Scorecard: cargo xtask perf + scorecard, budgets, checklists, nightly perf (#221) (#239) (#239) 2026-10-05 10:53:02 -04:00
text Type: a forced line break (U+0003) breaks the line instead of drawing a box (#644) 2026-10-07 16:31:33 -04:00
ui-egui Fix ui.set brush size command journaling (#744) 2026-10-07 13:49:59 -07:00
vector Live gradients: Gradient tool makes editable Gradient Fill layers (on-canvas handles, stops, midpoints) + Classic mode (#180) (#197) (#197) 2026-10-05 12:04:52 -04:00