Is there any way to set a specific level of jpeg compression and vary that according to the upload destination? I'm trying to work out how best to integrate EE's native image upload features with the soon-to-be-standard picture element, and in particular to make use of the compressive images technique. This method involves saving retina images at maximum compression/minimum picture quality, generally resulting in smaller file sizes than those of non-retina resolutions saved at a more 'normal' compression level.
The problem comes when EE performs any sort of resizing, because it resaves the jpeg at a fairly high quality (level 9 out of 10, I think), which completely undoes the file size benefits of an image originally saved using the compressive images method. So either the client must create the retina image at a size that requires no resizing by EE (not very end user-friendly, and doubly-unwieldy if you need more than one size of retina image), or one must do away with trying to use the compressive images method.
I know that CE Image can adjust the compression on the fly, but AFAIK it does so on the image tag itself, which won't mesh very well with the picture element syntax (you'd need to apply CE Image's 'quality=""' parameter to the source srcset attribute of the Picture element… I think). So the only way around it would seem to be to establish separate upload destinations (or specific image-manipulation sub-destinations) that have their own specified compression level.
So I upload a big image, say 1700px wide, to the upload destination blog_images. The max width for the destination is set to 1200px and maximum compression (quality = 0) -- this becomes my retina image. There is also an image manipulation set for that destination that resizes the image to a width of 600px and saves it with normal compression (quality = 9). That becomes my non-retina image. Of course I can imagine various further image manipulations with different compression levels -- mobile size retina and non-retina images, for example.
Is this varying of compression levels possible any way?