I've noticed that ImageMagick does a much better job than GD2 for some things - canvas operations with transparency are much much faster for example.

But GD2 does a considerably better job of jpeg compression - at the same visual quality (not numeric quality), the file size of a jpeg saved by GD2 will be quite a bit smaller than the equivalent jpeg saved by ImageMagick. Mobile users and responsive images, I'm looking at you.

So I was wondering whether there is any technical barrier to selecting the toolkit to be used for each image style. At the heart of it is the $image object that gets passed around, and the toolkit seems to be specified by $image->toolkit. It shouldn't be a problem to make that a per-style setting, right?

The only possible gotcha I can think of is that some effects may be supported by one toolkit but not by another (not sure of this)?

An initial search doesn't turn up any module already providing this, but I'd love to be wrong on that.

Any thoughts, anyone?