Skip to main content
mu-files
Participant
May 2, 2026
Question

bitspersample < 16bit and jpegxl

  • May 2, 2026
  • 0 replies
  • 33 views

In building a python library to write and render DNG files (https://github.com/mu-files/mu-image/tree/main/muimg) we noticed that 10bit raw data is handled inconsistently between uncompressed DNG and JXL DNG.

In the DNG SDK: 
- For uncompressed data - 10bit data is packed in the tiff ifd, then gets unpacked in the decoder and goes through the DNG renderer as values in the lower 10 lower bits of a 16 bit buffer.

- For the JXL path, our initial attempt was to tell the JXL encoder to store 10 bit data. The inconsistency we ran into is that the DNG SDK code requests this bitstream as JXL_BIT_DEPTH_FROM_PIXEL_FORMAT - which tells the JXL decoder to shift the 10bit data up to the full 16 bit depth of the buffer being used.

So from the DNG encoder side we cannot treat 10 bit data the same if it is being encoded as uncompressed or as JXL. If the DNG SDK code requested the data from jxl decoder using JXL_BIT_DEPTH_FROM_CODESTREAM then the decoder would return the 10bit data that the encoder intended.

Would be interested in your guidance here.

Thanks!