This is a toolkit for ImageAPI. It requires imageapi_gd or imageapi_imagemagick or any ImageAPI toolkit to work.

ImageAPI Optimize allows you to use your preferred toolkit and optimize (losslessly) the image when it is saved. Practice for web performance suggests that images should be optimized for better loading time. With this module enabled, Google's Page Speed will always give you an A in image optimize.

This module supports 3rd services (like Yahoo! SmushIt, since 1.5) or many tools if you can compile them on your server. Read the documentation page for a full list of supported tools.

The size reduction varies on the original image, normally between 10-30 KB if image is not optimized before. All optimizations are lossless, but metadata is removed.

This module was featured on Lullabot's Module Monday.


  • Lossless optimization
  • Works with any toolkit (GD or Imagemagick)
  • Pluggable optimization tools

Quick install instruction

- Download imageapi_optimize (and imageapi, if you don't have it yet), enable it.
- Go to ImageAPI settings page (admin/settings/imageapi), select ImageAPI Optimize as the default toolkit instead of GD or Imagemagick
- Go to ImageAPI Optimize settings page, select SmushIt if you haven't other tools compiled.

Drupal 7

Despite the name, this module does not depend on ImageAPI. It depends only on the core image.module. Please read the documentation page for more information.

If you prefer Image Magick over GD, please use ImageMagick module instead of ImageAPI (D7).

Drupal 8

See Drupal 8 port.

Project Information