-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lossless JPEG #21
Comments
I'm trying to understand how the DHT table is composed for Lossless JPEG, it'd be great if you could add support for the SOS header in SOF3 mode Here is a sample image I'm using: https://www.dropbox.com/s/2vxl1h6wmo97lse/Lossless.jpg?dl=0 |
Thank you Laurent -- that is an excellent summary you created. |
I'm not understanding how a code is mapped to a pixel value? from the image I posted earlier, the Huffman table is: 2[4, 5, 6] 4[2, 3, 7] 5[0] 6[1] 7[8] 8[A] 9[9] 10[B] 11[C] where the number outside of the brackets is the number of bits, and the number(s) inside the brackets are the values. how do I find out which pixel 11[C] maps to? 11[C] would be what binary string, and what would that binary string map to pixel wise? |
Hello Marcus! First, I must caveat this by saying that I have not spent much time decoding lossless JPEG images in detail, but perhaps this may help you get started with your question. Unlike BMP-formatted images, a singular JPEG Huffman code doesn't directly map to a pixel value. I would recommend starting with a read through my JPEG Huffman coding tutorial first, as the differential coding scheme is covered in moderate detail with a simple two-block example. You will find that each Huffman code basically describes the "change in value" from a previous block or predicted block. More specific to your question: Your Huffman code "11[C]" is mapped as follows (according to JPEGsnoop with DHT Expand option enabled):
Once you encounter the bit sequence In the case of lossless JPEG images, the changes are based not on the previous DCT block but a predicted value from neighboring blocks. See https://en.wikipedia.org/wiki/Lossless_JPEG Hope that helps! |
Decode lossless JPEG files
[2010/10/16] First created at https://sourceforge.net/p/jpegsnoop/feature-requests/24/
The text was updated successfully, but these errors were encountered: