Advertising sustains the DA. Ads are hidden for members. Join today

On this page

ImageAPI Optimize documentation

Last updated on
23 September 2021

Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites

This article helps site administrators configure ImageAPI Optimize to have optimized image output size.

The module supports several tools to do this, for different image formats. ImageAPI Optimize can manipulate newly created images only, so it cannot optimize existed images. For such usage, you can use a bash script written by Joel Hardi.

Image optimization requires external tools written mainly in C/C++. You can download and compile them yourself. Some are available as binary. Some are already present on most systems.

  • (PNG) advpng is a part of advancecomp. It is available in most distros (Debian). If you don't have root access to the server you will need to compile it.
  • (PNG) OptiPNG is a tool to optimize PNG images. This module uses the default option for a size/execution time trade-off. OptiPNG can be built by ./configure;make. There is also a Debian package.
  • (PNG) PNGCRUSH predecessor where optipng was forked.
  • (JPEG) jpegtran is a part of jpeglib and is available in most systems, if not please install the package libjpeg-progs. This tool can remove extra markers from source file.
  • (JPEG) jpegoptim can do lossless and lossy recompression of JPEG images (Debian package).
  • (JPEG) jfifremove strip JFIF headers. You need to compile it: gcc -o jfifremove jfifremove.c

The module is open for more tools. But the size/time trade-off must be considered. You can also use 3rd party service like smush.it.

Drupal 7 install note

Since this module is no longer dependent on the ImageAPI module, the settings are not situated under admin/settings/imageapi any more, but under admin/config/media/image-toolkit

Help improve this page

Page status: No known problems

You can: