pbakaus/impeccable · warning

[impeccable] shader bitmap decode failed:

Error message

[impeccable] shader bitmap decode failed:

What it means

After the shader overlay's GL setup succeeds, the captured screenshot blob is decoded with createImageBitmap before texture upload. If decoding rejects — empty/corrupt blob from a racing capture, decode OOM, browser quirk — the code logs 'shader bitmap decode failed:', force-loses the WebGL context via WEBGL_lose_context, and shows showShaderBitmapFallback: a static, non-GL rendering of the same image.

Solutions

  1. No action needed — the static fallback shows the same screenshot
  2. If this recurs, chase the upstream capture path (a decode failure usually means the blob was never valid)
  3. Retry the generate to get a fresh capture and a working animated overlay
Defensive patterns

Strategy: fallback

Validate before calling

if (!blob || blob.size === 0) { showShaderBitmapFallback(canvas, blob); return; } // skip decode for empty blobs

Try / catch

try { bitmap = await createImageBitmap(blob); } catch (err) { console.warn(err); gl.getExtension?.('WEBGL_lose_context')?.loseContext(); showShaderBitmapFallback(canvas, blob); return; }

Prevention

When it happens

Trigger: The blob passed in is empty or truncated because capture raced DOM teardown (see the capture-failed path); image decode under memory pressure; browsers with partial createImageBitmap support for PNG blobs.

Common situations: See trigger scenarios.

Related errors


AI-assisted analysis of pbakaus/impeccable@f2c7051853 (2026-08-18). Data as JSON: /api/errors/9fa009f105131619. Report an issue: GitHub.

Appendix: source

Thrown at skill/scripts/live-browser.js:8870

  // (which returns null when the element paints its own bg), this always returns
  // a usable color: the element's own background if any, else the nearest opaque
  // ancestor, else the paper fallback.
  // Rasterize any CSS color (oklch, color(), named, hex, rgb) through a 1x1
  // canvas and read back the sRGB pixel. String-parsing computed colors is a
  // trap: Chrome returns backgroundColor as oklch()/color() for oklch inputs,
  // which a hex/rgb regex misses - every site token would fall back to white.
  let colorParseCtx = null;
  function cssColorToRgb01(str) {
    if (!colorParseCtx) {
      colorParseCtx = document.createElement('canvas').getContext('2d', { willReadFrequently: true });
    }
    // Clear first: the ctx is cached across calls, so a semi-transparent color
    // would otherwise blend (source-over) with the previous call's leftover
    // pixel, making the result depend on call history.
    colorParseCtx.clearRect(0, 0, 1, 1);
    colorParseCtx.fillStyle = '#000'; // invalid input leaves this default
    colorParseCtx.fillStyle = str;
    colorParseCtx.fillRect(0, 0, 1, 1);
    const d = colorParseCtx.getImageData(0, 0, 1, 1).data;
    return [d[0] / 255, d[1] / 255, d[2] / 255];
  }
  function resolvePaperRgb(el) {
    let node = el;
    while (node) {
      const bg = getComputedStyle(node).backgroundColor;
      if (!isTransparentColor(bg)) return cssColorToRgb01(bg);
      node = node.parentElement;
    }
    return SHADER_PAPER_FALLBACK;
  }

  // When an element is transparent up to the root, its visible backdrop can
  // still come from an ancestor's background-image or a covering positioned
  // layer that is a *child* of an ancestor (e.g. a hero's absolute art div) -
  // neither of which the ancestor background-COLOR walk can see. Return the
  // nearest such ancestor so we can capture it and crop, embedding the real

View on GitHub (pinned to f2c7051853)