mirror of
https://github.com/storytold/photocraft.git
synced 2026-10-27 19:36:56 -06:00
In Photoshop a clipping base's Fill opacity fades only the base's own pixels: the clipped layers show at full strength inside the base's shape (its alpha with masks), and the whole group then blends in the base's mode at the base's opacity. A base at 0 % fill (an invisible shape or text with photos clipped to it) still shows its clipped layers. PhotoCraft composited the clipped layers into the base's content and faded the result by the base's fill, so they vanished. - CPU: plain, shape and effects bases below 100 % fill build the clipping group in the base's shape (`clips_by_shape`, `composite_clipped_in_shape`); with effects the base's alpha stays the effect shape and the group's own alpha becomes a per-pixel fill. - GPU: the same model in the planner (Lerp by the base's alpha, per-pixel fill in the effect init), so these documents stay on the GPU and match the CPU oracle. - A clipped Dissolve layer draws each pixel fully or not at all with the unclipped layer's noise (CPU atop path and GPU atop kernel), instead of blending as Normal. Tests: 1x1 expected values (fill 0/50/100 %, group on/off, base opacity, base mask, effects) at 8/16/32-bit; clipped Dissolve pixel counts, including a Solid Color fill clipped to the Background; GPU/CPU parity across depths, base modes, opacity, masks and effects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>