Skip to content

Fixes #5502 - Shadows now overlay raster ImageView (Sixel & Kitty)#5506

Merged
tig merged 13 commits into
developfrom
tig/fix-raster-shadow-overlay
Jun 19, 2026
Merged

Fixes #5502 - Shadows now overlay raster ImageView (Sixel & Kitty)#5506
tig merged 13 commits into
developfrom
tig/fix-raster-shadow-overlay

Conversation

@tig

@tig tig commented Jun 19, 2026

Copy link
Copy Markdown
Member

Fixes

Follow-up to #5493. Addresses the one outstanding review item from that PR — @YourRobotOverlord's approving-review nit: "shadows do not overlay the image" (reproduces on both Sixel and Kitty). All of the automated reviewer comments on #5493 were already resolved before merge (re-audit in #5502).

Root cause

Raster images are composited by the terminal on top of the text-cell grid. To let the image show through, OutputBase skips emitting blank cells that fall within a raster image's DestinationCells — but the check (IsRasterCoveredBlankCellIsBlankCell) was grapheme-only, so it also dropped a shadow cell (a blank space carrying an opaque dimmed background). The shadow therefore vanished over the image.

Fix

  • OutputBase — new IsRasterOwnedBlankCell: a blank cell is raster-owned (and suppressed / cleared-through) only when its background is transparent (Background.A == 0). An opaque blank (a shadow, a colored fill) is intended overlay content and is emitted so it paints over the image (Sixel) or appears above the z=-1 placement (Kitty). Used by both the main-loop suppression and ClearKittyRasterBlankCells.
  • ImageView — marks its raster-covered cells transparent (Color.None) so image-owned cells stay suppressed while later opaque overlays show through.

The behaviour is symmetric across Sixel and Kitty (Kitty images are already placed at z=-1, below the text layer).

Tests

  • Two new failing-first tests in OutputBaseTests (Write_SixelRasterImage_EmitsOpaqueBlankOverlayCell_SoShadowsOverlayImage, Write_KittyRasterImage_…) — red before the fix, green after.
  • Full parallelizable suite 17,423 passed / 0 failed; ImageView 76 ✓; Shadow 35 ✓; NonParallelizable ✓.

Visual verification

Reconstructed from the app's real terminal output (Kitty graphics placement at z=-1 composited under the ANSI cell layer). Two identical shadow-casting boxes — one over a raster image, one over the window background (control). Before: the over-image shadow vanishes. After: it matches the control.

🤖 Generated with Claude Code

tig and others added 13 commits April 8, 2026 13:37
Blank cells carrying an opaque background (e.g. a View's shadow) drawn
over a raster image were suppressed along with the image's own
transparent cells, so shadows vanished over Sixel/Kitty images.

OutputBase now treats only transparent (alpha-0) blank cells as
raster-owned; opaque blanks are emitted so they paint over the image
(Sixel) or appear above the z=-1 placement (Kitty). ImageView marks its
raster-covered cells transparent so image-owned cells stay suppressed
while later opaque overlays show through.

Adds failing-first OutputBase tests for the Sixel and Kitty paths.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shadows (and blank colored overlays) do not overlay raster ImageView (Sixel & Kitty) — follow-up to #5493

1 participant