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 statistics in the system information toolbar
- Compression status visible in sys_file_metadata edit view
- System report with per-provider statistics in Admin Tools
Requirements: TYPO3 >= 12.4 Β· PHP 8.2+
composer require move-elevator/typo3-image-compressionDownload the zip file from the TYPO3 Extension Repository (TER).
Configure the extension in Admin Tools > Settings > Extension Configuration.
| 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 |
- Register at TinyPNG Developers to obtain your API key.
- Set Provider to
tinifyand enter your API key. - Free tier: 500 compressions/month β upgrades available via the TinyPNG dashboard.
Warning
The free API limit (500 compressions/month) can be exhausted quickly on large sites with many existing images. Use the CLI --include-processed flag with caution.
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 independently.
Once configured, all images with a supported MIME type uploaded via the TYPO3 backend are automatically compressed.
Use the CLI command to compress images that were uploaded before the extension was installed.
Important
Before running the CLI command, ensure your TYPO3 file index is up to date. Run the scheduler task "File Abstraction Layer: Update storage index" first.
# 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). Omit to save API quota β processed files are regenerated from already-compressed originals. |
--retry-errors, -r |
Retry compression for files that previously failed. Clears error status on success. |
Tip
When using the tinify provider, omit --include-processed to conserve your monthly API quota. Processed files are regenerated from the already-compressed originals anyway.
- System information toolbar β displays current API usage (TinyPNG) or compression statistics.
- System Reports (
Admin Tools > System Reports) β active provider, per-file-type statistics, and API usage. - File metadata (
sys_file_metadata) β per-file compression status and error messages.
This project is a fork and further development of the great tinyimg extension.
Please refer to CONTRIBUTING.md.
This project is licensed under the GNU General Public License 2.0 (or later).