Skip to content

NEF decoding produces different pixel values after latest WASM update #12

@lexluthor0304

Description

@lexluthor0304

Description

After updating to the latest LibRaw-Wasm build (upstream commit
82c9246), NEF files decode to noticeably different pixel values compared
to the previous version. This causes a visible color shift in the output image.

Reproduction

  1. Decode the same NEF file using both versions of LibRaw-Wasm
  2. Compare pixel values in a flat area (e.g. the film base/rebate of a scanned negative)

Observed difference

Sampling the same region from the same file:

Version R G B
Previous build (libraw.wasm 1,327,763 bytes) 236 162 126
Latest build (libraw.wasm 1,426,002 bytes) 238 142 91
Delta +2 -20 -35

The green and blue channels shift significantly, resulting in a warmer / more orange-tinted decode. This
s not a subtle rounding difference — the B channel drops by 35 out of 255.

Impact

My application uses the decoded pixel values to auto-detect the film base color and remove the orange
mask from color negatives. The large shift in G and B channels causes the automatic color correction to
produce a visibly different (and incorrect) result.

Environment

  • Browser: Chrome (macOS)
  • Previous libraw.wasm: 1,327,763 bytes (working correctly)
  • Updated libraw.wasm: 1,426,002 bytes (color shift)

Expected behavior

The same NEF input should decode to the same (or very close) RGB values across builds, unless there is a
documented change in the demosaicing or color pipeline.

Questions

  • Was there an intentional change to the color pipeline, white balance handling, or demosaicing algorithm
    in LibRaw upstream?
  • Is there a way to configure the new build to match the previous output?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions