Imagizer

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
gilles
Posts: 1
Joined: 2016-04-13T09:03:26-07:00
Authentication code: 1151

Imagizer

Post by gilles »

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.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Imagizer

Post by Bonzo »

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.
Post Reply