Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

TinyPNG

1,363 sites Security covered
View on drupal.org

This module integrates with TinyPNG to automatically compress your image files upon upload, reducing their size without a noticeable loss in quality. This leads to faster load times and reduced bandwidth usage for your website.

Provides TinyPNG integration.

What does TinyPNG do?

TinyPNG uses smart lossy compression techniques to reduce the file size of your PNG files. By selectively decreasing the number of colors in the image, fewer bytes are required to store the data. The effect is nearly invisible but it makes a very large difference in file size!

Why should I use TinyPNG?

PNG is useful because it's the only widely supported format that can store partially transparent images. The format uses compression, but the files still can be large. Use TinyPNG to shrink images for your apps and sites. It will use less bandwidth and load faster. For more information about TinyPNG please visit https://tinypng.com/.

For more information about TinyPNG please visit https://tinypng.com/.

Drupal 8/9

Manual installation is not supported for Drupal 8/9 version of TinyPng. Please use composer to install TinyPNG for Drupal8 or 9!

Installation

  1. Install module with composer
    cd $DRUPAL
    composer require drupal/tinypng
  2. Enable as you would normally install a contributed Drupal module. See: https://www.drupal.org/node/895232 for further information.

Note: we are assuming that you have a Composer based Drupal installation, where the docroot (usually called www) is not the same as the site’s root directory but a subdirectory in that. For more info, see: https://www.drupal.org/docs/develop/using-composer/using-composer-to-manage-drupal-site-dependencies.

Configuration

Having installed the module, go to /admin/config/tinypng page and set your TinyPNG API key. On the same page you can select the mode you want to compress images.

With Compress on upload mode you will compress images when they are uploaded.

With Enable TinyPNG image action mode you will have the opportunity to keep your original image untouched and select the image styles you want to compress. When this mode is enabled you can add TinyPNG effect to any of your image styles.

Drupal 7

How does it work?

For Drupal 7 this module creates a new ImageToolkit which uses other toolkits in the background. The secondary toolkit could be the core GD or the ImageMagick toolkit provided by ImageMagick module. TinyPNG module just calls the functions of the secondary toolkit in the background but in the last step it sends the image to the TinyPNG API to compress it.

Requirements

Requirements

Download Tinify PHP (v1.3.1+) library from https://github.com/tinify/tinify-php/ and place it under $DRUPAL_ROOT/sites/all/libraries.

After Tinify PHP library installation the Tinfiy.php should be found at $DRUPAL_ROOT/sites/all/libraries/tinify-php/lib/Tinify.php

Then install the module as you would normally install a contributed Drupal module. See: https://drupal.org/documentation/install/modules-themes/modules-7 for further information.

Installation via Drush

If you install tinypng module via drush command: drush en tinypng, the library will be downloaded and placed the proper place. The module provides a separate Drush command for easy installation just of the Tinify-PHP library too: drush tinypng-library.

Configuration

  1. Having installed the module, go to admin/config/media/image-toolkit page and select TinyPNG as default Image toolkit and save the form.
  2. Then set your TinyPNG API key, select the secondary toolkit and save the form.
  3. Configure the secondary toolkit too.

Activity

Total releases
1
First release
Feb 2026
Latest release
5 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Release date
2.0.1 Stable Feb 10, 2026