Skip to main content
Drupal is a registered trademark of Dries Buytaert
EOL Warning: Drupal 11.0 has reached end of life and no longer receives security updates. EOL Warning: Drupal 10.3 has reached end of life and no longer receives security updates. EOL Warning: Drupal 10.2 has reached end of life and no longer receives security updates. EOL Warning: Drupal 10.1 has reached end of life and no longer receives security updates. EOL Warning: Drupal 10.0 has reached end of life and no longer receives security updates. EOL Warning: Drupal 9.5 has reached end of life and no longer receives security updates. EOL Warning: Drupal 9.4 has reached end of life and no longer receives security updates. EOL Warning: Drupal 9.3 has reached end of life and no longer receives security updates. Usage Milestone: jQuery UI Datepicker Module jquery_ui_datepicker crossed 1,000 active installs. Release: Module Builder 4.2.6 Minor update available for module module_builder (4.2.6).

This module helps automatically optimize images generated by Drupal's Image Styles using the ShortPixel API. It uploads generated images for compression and replaces them with optimized versions, while keeping your original images untouched. It also supports different compression modes and can optionally deliver optimized images via the ShortPixel CDN.

ShortPixel ImageAPI Optimize Processor is a custom Drupal module that integrates the ShortPixel POST-Reducer API as an optimization processor for the ImageAPI Optimize module.

The processor automatically optimizes images generated by Drupal Image Styles by uploading the generated file to ShortPixel and overwriting only the generated image style file, while keeping the original source image untouched.

The module fully respects Drupal’s image handling architecture and Drupal best practices.

Features

Supported Compression Modes

The processor supports all official ShortPixel compression strategies:

Lossy – Best balance between image quality and file size. Recommended for most websites.
Glossy – High-quality compression with minimal visual loss. Ideal for photography and premium visuals.
Lossless – Pixel-perfect optimization with no visual changes. Best for technical images and graphics.

The compression mode can be selected directly from the ImageAPI Optimize processor configuration.

CDN Delivery Mode

The processor can also rewrite public image URLs to the ShortPixel Adaptive Images CDN format.
Enable Rewrite public image URLs to ShortPixel CDN
Set the CDN base URL to https://cdn.shortpixel.ai, https://no-cdn.shortpixel.ai, or your own CDN host
The module rewrites public image URLs to the Adaptive Images API format and keeps the selected compression mode in sync
When CDN delivery is enabled, local Post-Reducer uploads are skipped and the CDN handles optimization and format negotiation

Post-Installation

Drupal generates an image using an Image Style
(the image is stored under the /styles directory)
ImageAPI Optimize invokes the ShortPixel processor
The generated image is uploaded to ShortPixel via the POST-Reducer API
The processor polls the API until optimization is complete
The optimized image replaces the generated Image Style file
The original image remains unchanged, as required by Drupal standards

For a deeper technical explanation, see the inline documentation in ShortPixel.php.

Additional Requirements

The module needs a ShortPixel API Key that you can get for free at shortpixel.com - the free account includes 100 image optimization per month.

Depends on

Dependencies of the latest stable release

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
3
Tracked since
Jul 2026
Latest release
1 month ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
1.1.1 Stable 9–11 Jul 22, 2026
1.1.0 Stable 8–11 Jul 22, 2026
1.0.0 Stable Jul 14, 2026