Files
photocraft/crates/engine
xwizeandClaude Opus 5.5 e22984536c Indexed Color: keep Brush strokes inside the colour table
An Indexed Color document keeps its pixels expanded to RGB with the palette
as side data, and the Brush rendered straight onto that surface. A red
stroke on a black/white document therefore left opaque red pixels, and soft
edges or partial opacity left blends, all outside the colour table, while the
document still reported Indexed mode. Photoshop (and GIMP, which documents
it) paint the nearest table colour instead.

The stroke commit now maps the damaged rectangle to the nearest table entry
with the same no-dither quantiser the Indexed Color conversion uses. That
keeps the table's transparent entry binary as well. The live preview
applies the same step, so the canvas shows the pixels the commit keeps.
This covers paint.stroke and paint.pencil, including erasing. Masks and
channels are gray targets and are left alone.

Fixes #8669

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:18:30 +01:00
..