This TYPO3 extension automatically compresses images uploaded to the TYPO3 backend. Choose between the TinyPNG API for best results or local tools for cost-free compression.
- Multiple compression providers: TinyPNG API, local optimized tools, or ImageMagick/GraphicsMagick
- Automatic compression of JPG, PNG, GIF, AVIF and WebP images on upload
- CLI command for batch processing existing images
- Configurable quality settings for local compression
- Image compression statistic in the system information toolbar
- Image compression info in sys_file_metadata edit view
| Provider | Tools | Compression | Cost | Best For |
|---|---|---|---|---|
tinify |
TinyPNG API | ~70-80% | API quota | Production, best quality |
local-tools |
jpegoptim, optipng, pngquant, gifsicle, cwebp | ~50-60% | Free | Self-hosted, no API costs |
local-basic |
ImageMagick / GraphicsMagick | ~30-40% | Free | JPEG only, quick setup |
- TYPO3 >= 12.4
- PHP 8.2+
composer require move-elevator/typo3-image-compressionDownload the zip file from TYPO3 extension repository (TER).
Configure the extension in Admin Tools > Settings > Extension Configuration.
Choose the compression provider from the dropdown.
- Register at TinyPNG Developers to obtain your API key
- Set Provider to
tinifyand enter your API key - Free tier: 500 compressions/month, paid upgrades via TinyPNG dashboard
Warning
Be aware that the free API limit (500 compressions/month) can be exhausted quickly on large sites with many existing images.
Install the required tools on your server:
# Debian/Ubuntu
apt install jpegoptim optipng pngquant gifsicle webp
# macOS (Homebrew)
brew install jpegoptim optipng pngquant gifsicle webpSet Provider to local-tools. The extension auto-detects available tools.
No additional installation needed - uses TYPO3's configured graphics processor. Set Provider to local-basic.
For local providers, configure quality (1-100) for JPEG, PNG, and WebP compression.
Once configured, all images (with supported mime type) uploaded via the TYPO3 backend will be automatically compressed.
For existing projects, a CLI command is available to compress images that were uploaded before the extension was installed.
# Compress up to 100 original images (default)
vendor/bin/typo3 imagecompression:compressImages
# Compress up to 50 images
vendor/bin/typo3 imagecompression:compressImages 50
# Also compress processed files (thumbnails, crops, etc.)
vendor/bin/typo3 imagecompression:compressImages --include-processed
# Retry failed compressions
vendor/bin/typo3 imagecompression:compressImages --retry-errors
# Combine options
vendor/bin/typo3 imagecompression:compressImages 200 --include-processed --retry-errors| Argument/Option | Description |
|---|---|
limit |
Number of images to process (default: 100) |
--include-processed, -p |
Also compress processed files (thumbnails, crops). By default, only original files are compressed to save API quota. |
--retry-errors, -r |
Retry compression for files that previously failed. On success, the error status is cleared. |
Tip
When using Tinify (TinyPNG API), we recommend not using --include-processed to conserve your API quota. Processed files are regenerated from the already-compressed originals.
Important
Before running the CLI command, ensure your TYPO3 file index is up to date. Use the scheduler task "File Abstraction Layer: Update storage index" to update the index.
The extension displays the current API usage (TinyPNG) or compression statistics in the TYPO3 backend toolbar.
A detailed compression report is available in Admin Tools > System Reports. It shows the active provider, compression statistics for original and processed files, and API usage for TinyPNG.
The compression status of individual files is displayed in the file metadata form (sys_file_metadata). Edit a file's metadata to see whether it has been compressed, and any error messages if compression failed.
This project is a fork and further development of the great tinyimg extension.
Please have a look at CONTRIBUTING.md.
This project is licensed under GNU General Public License 2.0 (or later).