I came across this interview, which might be of interest to IM developers: https://scaleyourcode.com/interviews/interview/23
The interviewee describes a closed source product (written from scratch, not IM-based) of his that claims to resize JPEGs of any size in 25ms or less on m3.medium AWS instances. I have ex-colleagues of mine at deviantArt who've tried it and confirmed the outstanding performance. He shares enough information in the interview to piece together the techniques used, namely:
- the inspiration for the code is an unnamed Japanese paper which describes how to process the Y, U and V components of a JPEG in parallel
- it uses the technique of only sampling parts of the image, whereby only parts of the JPEG are read, instead of every pixel, according to the needed target thumbnail size (similar to IM's jpeg:size, I presume)
- it leverages "vector math" in the processor, which I assume means AVX instructions and registries, since he mentions registries at some other point of the interview
I was mostly curious to know if these optimizations are something IM already does to a degree. And if not, if that sounds like something IM developers might explore.
Imagizer
Re: Imagizer
I believe this reads in part of the jpg depending on the size set rather than the whole image:
jpeg:size=geometry Set the size hint of a JPEG image, for example, -define jpeg:size=128x128. It is most useful for increasing performance and reducing the memory requirements when reducing the size of a large JPEG image.