I need to do image loose-compressing usually done with GIMP/TinyPNG/GPI, but just inside Drupal, but also For all images, in a single process or several sporadic processes (say, for each content type).

This could save much time instead of download, compress, reupload, etc.

Is there a way to loose-compress all images in the application so that webpages containing them load faster?

If you don't know such a tool but does know a way to show all nodes that has images, please comment naming such a tool, so it could at least help in the alternative of downloading and manually loosely-compressing each image before re uploading it.

  • 1
    I think the question is about "lossy compression" for PNGs. is that right?
    – mradcliffe
    Commented Aug 25, 2016 at 17:44
  • 1
    I use pngquant to do lossy compression. It is possible to run that process on multiple files at once. It is already a part of libgd so perhaps it is already supported in image styles in Drupal?
    – mradcliffe
    Commented Aug 25, 2016 at 17:48

2 Answers 2


You're looking for this but in D8 - https://www.drupal.org/project/imageapi_optimize. You can still use the tools to do it manually.

PNG - Use https://pngquant.org/ first with these settings --speed=1 --quality=90-99 --force --ext .png and then https://github.com/subzey/zopfli-png
JPG - https://github.com/mozilla/mozjpeg and then https://stackoverflow.com/questions/5579183/jpegtran-optimize-without-changing-filename

EDIT: This new D8 project just appeared https://www.drupal.org/project/file_processor


Drupal core has a setting out of the box that allows you to compress all images on upload. See admin/config/media/image-toolkit.

My image compression plan is to use that setting of 75% for basic compression.

On top of this I'll install the Image effects module and use the "Strip" effect to remove metadata and the and "Interlace" option to make my jpeg's progressive and significantly increase perceived speed.

The Image effects module uses the GD2 image kit that core already uses, so by using it I'm not required to worry about installing any other server tools or rely on a 3rd party API.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.