I need to use some part of a jpeg image (a rectangle in the center) decompressing it up to DCT coeficients. Is this possible with libjpeg , or some other open source tool ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you’re asking to do is non-standard use case. It is unlikely any open source library will have this feature built-in. It shouldn’t take major modifications to get the data you need. How much effort are you willing to provide and how much do you understand the JPEG standard and the library you’re using?
If your requested rectangle is on MCU boundaries, then it should be relatively simple to modify the decode loop to copy out the coefficient data that you’re interested in. I am not familiar with the open source JPEG libraries, but within my own JPEG codec, the changes required would be trivial.