ExifTool Forum

General => Metadata => Topic started by: bcomstock on March 29, 2023, 10:08:30 AM

Title: JP2: Bits Per Component : Variable
Post by: bcomstock on March 29, 2023, 10:08:30 AM
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!
Title: Re: JP2: Bits Per Component : Variable
Post by: Phil Harvey on March 29, 2023, 10:35:36 AM
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
Title: Re: JP2: Bits Per Component : Variable
Post by: bcomstock on March 29, 2023, 11:10:30 AM
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.