ImpulseAdventure / JPEGsnoop

JPEGsnoop: JPEG decoder and detailed analysis
http://www.impulseadventure.com/photo/jpeg-snoop.html
GNU General Public License v2.0
499 stars 83 forks source link

Support for displaying 12-bit grayscale JPEG saved with Huffman or arithmetic coding #51

Closed levicki closed 3 years ago

levicki commented 3 years ago

@ImpulseAdventure

Using JPEGSnoop 1.8.0 it is possible to examine files saved using IJG library compiled with JSAMPLE size of 12 bits.

Images compressed with Huffman coding can be shown, even though JPEGSnoop incorrectly defaults View -> Image Chan to RGB instead of Y. Sadly, the image display is corrupted -- it seems it is being decoded incorrectly.

However, 12-bit grayscale images compressed with arithmetic coding (which is now the default in IJG JPEG library v9) cannot be displayed at all.

I am attaching sample Huffman and arithmetic coded 12-bit gray JPEG images so you can take a look.

001_ac 001_huff

Finally, for the 001_huff image which displays as corrupted in JPEGSnoop, here is how it should look like when decoded correctly:

image