netresearch / nr-image-optimize
On-demand image optimization for TYPO3 with processed delivery, WebP and AVIF variants, and responsive srcset ViewHelpers.
Package info
github.com/netresearch/t3x-nr-image-optimize
Type:typo3-cms-extension
pkg:composer/netresearch/nr-image-optimize
Requires
- intervention/image: ^3.11
- typo3/cms-core: ^13.4
- typo3/cms-fluid: ^13.4
Requires (Dev)
- a9f/typo3-fractor: ^0.5
- friendsofphp/php-cs-fixer: ^3.88
- overtrue/phplint: ^9.6
- phpstan/phpstan: ^2.1
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- saschaegerer/phpstan-typo3: ^2.0
- ssch/typo3-rector: ^3.6
- typo3/testing-framework: ^9.0
Suggests
- christophlehmann/imageoptimizer: Optimize uploaded/processed images with binaries of your choice
This package is auto-updated.
Last update: 2026-03-28 09:50:59 UTC
README
Image Optimization for TYPO3
The nr_image_optimize extension provides on-demand image
optimization for TYPO3. Images are processed lazily via
middleware when first requested, with support for modern formats
(WebP, AVIF), responsive srcset generation, and automatic
format negotiation.
Features
- Lazy image processing. Images are optimized only when a visitor first requests them.
- Modern format support. Automatic WebP and AVIF conversion with fallback to original formats.
- Responsive images. Built-in
SourceSetViewHelperforsrcsetandsizesgeneration. - Render modes. Choose between
coverandfitresize strategies. - Width-based srcset. Optional responsive
srcsetwith configurable width variants andsizesattribute. - Fetch priority. Native
fetchpriorityattribute support for Core Web Vitals optimization. - Middleware-based processing. Lightweight frontend
middleware intercepts
/processed/requests. - Backend maintenance module. View statistics, check system requirements, and clear processed images.
Requirements
- PHP 8.2, 8.3, 8.4, or 8.5.
- TYPO3 13.4 or 14.
- Intervention Image library (installed via Composer automatically).
Recommended extensions
- imageoptimizer -- Optimize images with external binaries of your choice.
Installation
Via Composer (recommended)
composer require netresearch/nr-image-optimize
Manual installation
- Download the extension from the TYPO3 Extension Repository.
- Upload to
typo3conf/ext/. - Activate the extension in the Extension Manager.
Configuration
The extension works out of the box with sensible defaults.
Images are automatically optimized when accessed via the
/processed/ path.
ViewHelper usage
{namespace nr=Netresearch\NrImageOptimize\ViewHelpers}
<nr:sourceSet file="{image}"
width="1200"
height="800"
quality="85"
sizes="(max-width: 768px) 100vw, 50vw"
/>
Supported parameters
file- Image file resource.
width- Target width in pixels.
height- Target height in pixels.
quality- JPEG/WebP quality (1--100).
sizes- Responsive
sizesattribute. format- Output format:
auto,webp,avif,jpg,png. mode- Render mode:
cover(default) orfit. responsiveSrcset- Enable width-based responsive
srcsetinstead of density-based2x. Default:false. widthVariants- Width variants for responsive
srcset(comma-separated string or array). Default:480, 576, 640, 768, 992, 1200, 1800. fetchpriority- Native HTML
fetchpriorityattribute (high,low,auto).
Documentation
Full documentation is available in the Documentation/
directory and is rendered on
docs.typo3.org.
Development and testing
# Run all tests composer ci:test # Run specific tests composer ci:test:php:cgl # Code style composer ci:test:php:lint # PHP syntax composer ci:test:php:phpstan # Static analysis composer ci:test:php:unit # PHPUnit tests composer ci:test:php:rector # Code quality
License
GPL-3.0-or-later. See the LICENSE file for details.
Support
For issues and feature requests, please use the GitHub issue tracker.
Credits
Developed by Netresearch DTT GmbH.