mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-11 02:30:43 -06:00
The 8-bit stroke dither (render.rs `dither8`) ran on every stroke, including aliased ones. An aliased stroke paints each pixel by the same amount, so it has no gradient to band; dithering only scattered it over neighbouring levels. A 1 px Pencil line of 219/41/61 at 30% opacity over white came out as four colours (244/191/197, 245/191/197, 244/190/196, ...), and a foreground between 8-bit levels did the same at 100%. Photoshop's Pencil paints one value, and pixel art relies on it: a tolerance-0 Magic Wand or Paint Bucket and Indexed Color palettes trip on the grain. Composite now skips the dither when the brush is aliased (Pencil, Eraser Pencil and Block modes). Soft brushes keep it. Test: an_aliased_stroke_at_partial_opacity_is_one_flat_colour (fails before the fix at pixel 5). photocraft-paint 96/96, photocraft-engine 1529/1529, ui-egui pencil 13/13, clippy -D warnings and fmt clean. Co-authored-by: cloudalister <ngnlif3@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>