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

Fix display of jpeg with luminance subsampling (for instance, if MCU … #40

Closed alggm closed 6 years ago

alggm commented 6 years ago

…is Y=1x1, Cb=2x2, Cr=2x2).

Missing offset inside the MCU for the chroma components. For isntance, for the case where MCU is Y=1x1, Cb=2x2, Cr=2x2, the four 8x8 chrominance blocks ended up being written at the same location, thus most of the picture appeared in grayscale.

ImpulseAdventure commented 6 years ago

Excellent... thanks for identifying this! Do you have an example with luminance subsampling that you can attach to this issue? thx

alggm commented 6 years ago

Please find below a testcase with the suggested subsampling: jpegsnoopfixlumasubsampling_testcase You should observe the below difference after/before the fix: jpegsnoopfixlumasubsampling That is a random picture from Google ; I am not a red onion fanatic. Or maybe I am.

alggm commented 6 years ago

Do you need any more information @ImpulseAdventure ?

ImpulseAdventure commented 6 years ago

Thank you very much for providing the sample and associated fix!