I am working on a program that creates thumbnails of JPEG images on the fly. Now, I thought: since a JPEG image is built from 8x8 pixel blocks ( Wikipedia has a great explanation ), would it be possible to skip the decoding part?
Say my thumbnails are at least 8 times smaller than the original image. Then we could map each 8x8 block in the input file by 1 pixel at the decoding output, including only the constant term of the discrete cosine transform. Most of the image data can be immediately discarded and does not need to be processed. In addition, memory usage is reduced by 64 times.
I do not want to implement this from scratch; which will easily take a week. Is there any code that can do this?
If not, is it because this approach is not worth it, or simply because no one has thought about it yet?
resize thumbnails jpeg decode
Thomas
source share