You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Native pipeline renders a black background for CDG rips that declare a transparent key color #87
Tally feedback, 2026-08-14 (build 633cbef, footer trigger): "el archivo convertido no repeta el fondo original, solo pantalla de fondo en negro". PostHog shows the matching session: Chrome/Windows, cdg+mp3 pair ("FIESTA PAGANA - MAGO DE OZ"), 480p, pipeline webcodecs, conversion_succeeded, no download click, feedback submitted 8 minutes later.
Cause
Some CDG rips use instruction 28 (define transparent color) with a key color equal to the background palette index. The cdgraphics decoder emits those pixels with the correct RGB but alpha 0. The video pump (src/lib/webcodecs/encode.ts, pumpVideo) passes that ImageData to putImageData on a standard 2D canvas. Canvas backing stores are premultiplied, so (r,g,b,0) becomes (0,0,0,0); the background color is destroyed before the encoder ever sees the frame. The comment above globalCompositeOperation = "copy" assumes the encoder's alpha discard keeps the RGB, but the RGB is gone at putImageData time.
The cover-art path already handles this: renderTitleFrame calls discardAlpha(frame.data) before putImageData. The pump does not. Signature: the MP4's embedded cover art shows the correct background while the video is black.
Song-specific, not a general regression: only rips that declare a transparent key color matching the background are affected. Weekly analytics show 817/878 native conversions succeeding with downloads tracking successes.
The ffmpeg pipeline is unaffected; libavcodec's CDG decoder ignores the transparent-color instruction. Regression introduced with the native pipeline in #79.
Fix
Apply discardAlpha to frame.imageData.data in the pump before putImageData, mirroring the poster path (or create the contexts with { alpha: false }). Add a test with a CDG fixture that sets a transparent key color equal to the background.
Activity