Fixes #5502 - Shadows now overlay raster ImageView (Sixel & Kitty)#5506
Merged
Conversation
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>
This was referenced Jun 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,
OutputBaseskips emitting blank cells that fall within a raster image'sDestinationCells— but the check (IsRasterCoveredBlankCell→IsBlankCell) 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— newIsRasterOwnedBlankCell: 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 thez=-1placement (Kitty). Used by both the main-loop suppression andClearKittyRasterBlankCells.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
OutputBaseTests(Write_SixelRasterImage_EmitsOpaqueBlankOverlayCell_SoShadowsOverlayImage,Write_KittyRasterImage_…) — red before the fix, green after.Visual verification
Reconstructed from the app's real terminal output (Kitty graphics placement at
z=-1composited 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