Right now Perch doesn’t give you direct control over all the settings that I ended up finding useful. Even Imagick itself (the PHP integration with ImageMagick) doesn’t give you access to some useful things, like setting a specific filter to use with the thumbnail function. I ended up writing a PHP thing (https://packagist.org/packages/nwtn/php-respimg) that extends Imagick with the missing functionality, and that provides a “smart†resize function that uses the settings I recommend in the article.
I also wrote a grunt plugin that does the same stuff: https://www.npmjs.com/package/grunt-respimg. I'm actually using this with Perch, rather than the PHP thing. Basically I let Perch do its normal resizing when content is uploaded on our staging server, but I use the grunt plugin as part of my deploy to re-resize and optimize all the images. It's not ideal, but it's working fairly well for now.
As you've discovered, doing anything serious on your own server needs you to have the ability to install CLI tools and execute them from PHP. That's a non-starter for Perch on shared hosting.
I think using an external service for this makes a lot of sense. User environments are just way too unpredictable, and it really does get into advanced/expert territory. I haven't had a chance to try the Kraken integration yet, but I'm definitely looking forward to it!
Well, it took me awhile, but I finally got all my research and results written up at https://smashingmagazine.com/2015/06/25/efficient-image-resizing-with-imagemagick/.
Right now Perch doesn’t give you direct control over all the settings that I ended up finding useful. Even Imagick itself (the PHP integration with ImageMagick) doesn’t give you access to some useful things, like setting a specific filter to use with the thumbnail function. I ended up writing a PHP thing (https://packagist.org/packages/nwtn/php-respimg) that extends Imagick with the missing functionality, and that provides a “smart†resize function that uses the settings I recommend in the article.
I also wrote a grunt plugin that does the same stuff: https://www.npmjs.com/package/grunt-respimg. I'm actually using this with Perch, rather than the PHP thing. Basically I let Perch do its normal resizing when content is uploaded on our staging server, but I use the grunt plugin as part of my deploy to re-resize and optimize all the images. It's not ideal, but it's working fairly well for now.
After weighing it all up, we found the best route was to leave the fine tuning to experts. So we integrated with Kraken:
https://grabaperch.com/add-ons/apps/kraken
As you've discovered, doing anything serious on your own server needs you to have the ability to install CLI tools and execute them from PHP. That's a non-starter for Perch on shared hosting.
I think using an external service for this makes a lot of sense. User environments are just way too unpredictable, and it really does get into advanced/expert territory. I haven't had a chance to try the Kraken integration yet, but I'm definitely looking forward to it!