Resizing JPEG image during decoding

Posted by Thomas on Stack Overflow See other posts from Stack Overflow or by Thomas
Published on 2010-03-23T14:25:33Z Indexed on 2010/03/23 14:33 UTC
Read the original article Hit count: 577

Filed under:
|
|

I'm working on a program that creates thumbnails of JPEG images on the fly. Now I was thinking: since a JPEG image is built from 8x8-pixel blocks (Wikipedia has a great explanation), would it be possible to skip part of the decoding?

Let's say that my thumbnails are at least 8 times smaller than the original image. We could then map each 8x8 block in the input file to 1 pixel in the decoding output, by including only the constant term of the discrete cosine transform. Most of the image data can be discarded right away, and need not be processed. Moreover, the memory usage is reduced by a factor of 64.

I don't want to implement this from scratch; that'll easily take a week. Is there any code out there that can do this?

If not, is this because this approach isn't worthwhile, or simply because nobody has thought of it yet?

© Stack Overflow or respective owner

Related posts about jpeg

Related posts about decode