craft-imageoptimize
craft-imageoptimize copied to clipboard
Add support for Image optimization/transform services
Some people have shared/managed hosting where tools like jpegoptim
, etc. can't be installed.
Consider adding support for API image transforms for ~~Imgix~~, Cloudinary, kraken.io, and ImageOptim
Also consider adding Imgix and Cloudinary support, if that makes sense as well
Imgix has been added... the others will be pretty easy to add, too.
TinyPNG would also be a nice addition. It offers a free tier for up to 500 images per month, which is sufficient in many cases. We use Andrés imager plugin for several Craft 2 projects, which worked well in combination with TinyPNG.
Cheers.
Probably a silly question, but I assume it does more than just PNGs?
Yes, it supports JPEGs next to the obvious PNGs.
We are happy with the results and also google (or its tools) seemed satisfied with the optimised images. In contrast to the other services (if I am correct) you mention it doesn't host optimised images, you get them as back to store locally.
I'll have to take a look at their API; the lack of them hosting the images might actually make it slightly more difficult to implement.
This is a dealbreaker for me right now. We are using cloudanry almost everywhere on the site... I really lover your work @khalwat so it would be an immediate go if you can do this development. Right now we are not able to use seomatic either:( because if this issue... I mean the automatic transformer is not working at all because our external system is cloudanry... So I hope you will have the time to finish this up!
@matevisky Thanks for chiming in!
You can still use SEOmatic actually, you'd just use Twig to set the SEO images as you see fit:
https://github.com/nystudio107/craft-seomatic#twig-templating
@matevisky If you want to use ImageOptimize with Cloudinary, install the Cloudinary plugin that will make Cloudinary available as a file system for Craft CMS 3.
Tim Kelty has a warning that his Cloudinary plugin is not in active development. Any chance you might one day (no pressure) think about providing built-in support?
Adding a vote 👍 for Kraken.io support. Their compression is very impressive.
For example, I took a 1.7MB hero banner.jpg and ran it through ImgOptim (Mac app) and it got it down to 1.5 MB.
I took the 1.5MB file and ran it through Kraken and it got it down to 546KB.

Does it look like there will be built in support for Cloudinary, or will it always rely on a 3rd party plugin to support Cloudinary on the fly system?
Cloudinary is different from other services, in that you have to upload the files to Cloudinary first, it doesn't automatically pull them the way that Imgix does.
Because of this, it probably makes more sense as a Volumes driver of some kind, and then along with it a layer of support from ImageOptimize @zizther
I'm open to looking into it if the demand is there.
Thanks @khalwat One of the main features I like with Cloudinary is the auto cropping feature, which services like Imgix (which I also use) does not offer https://cloudinary.com/documentation/image_transformations#automatic_cropping_g_auto
I am speaking with Imgix to find out if they are working on a similar feature and the roadmap.
Are you still considering adding these services, namely TinyPNG?
Still considering... there just hasn't been a large demand thus far.