JP2: Bits Per Component : Variable

Started by bcomstock, March 29, 2023, 10:08:30 AM

Previous topic - Next topic

bcomstock

I'm reviewing a few corrupt JP2 files (according to JPYLYZER), and exiftool shows their Bits Per Component values to be, "Variable". What does that mean. I don't think I've ever seen that value.

Thanks!

Phil Harvey

You would have to read the JP2 specification to see exactly what that means.  I assume it means that the image is compressed with pixels of varying bit depth (but I'm stating the obvious).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

bcomstock

A colleague also offered an answer, FYI:

While it is "normal" for JP2s to have uniform bit depth in all channels, you can specify different depths on a per-channel basis.  If the BPC field of the Image Header Box "ihdr" is 0-254, then there is uniform bit depth (corresponding to 1-255 bits).  If BPC is 255, then the individual variable depths are defined in the Bits Per Component "bpcc" box.  I'm not sure how widespread support there is for variable bit depth in various rendering tools.