What this solution does
The Image Optimization module processes graphic files directly on the website server without transferring them to external services. For suitable source files, it generates WebP and AVIF formats, which are automatically substituted for the originals. A detailed activity log is maintained to ensure changes can be safely reverted.
Optimization supports JPEG, PNG, GIF, SVG, BMP, and WebP formats. The tool reduces disk space usage and data transfer volume, accelerates page loading, and enables centralized management of the media library. Parameters for quality, dimensions, format selection, directories, exclusions, and processing modes are configured individually for each site.
Processing can be triggered upon file upload, manually for existing images, via a background agent, or from the command line. Batch optimization runs in chunks with progress tracking and can automatically continue until the entire directory is processed. Large-scale projects feature persistent queue management, pause, resume, and recovery of incomplete tasks.
The module allows calculating optimization parameters without modifying files. In preview mode, the system displays current and target file sizes, projected storage savings, and quality metrics including SSIM and PSNR. Predefined quality profiles simplify selecting the optimal balance between image weight and visual fidelity.
The module supports compression and conversion for JPEG, PNG, GIF, SVG, BMP, and WebP formats. Generation of WebP and AVIF files is performed locally without relying on external services. Batch processing of existing images is available, along with automatic optimization of new files upon upload.
Processing can be executed by a background agent in the Bitrix system or triggered via the command line interface (CLI). Filters enable precise targeting of files by criteria such as site, directory, format, size, dimensions, and modification date. Separate optimization settings are supported for each resource in multi-site installations.
The module processes images from information blocks, sections, high-load blocks, forums, and the media library. It supports integration with custom tables containing Bitrix file identifiers. An integrated downscaling function automatically reduces the resolution of excessively large JPEG and PNG images.
Features include Progressive JPEG support, quality level management, and a mode that preserves original files. The system maintains a detailed processing log, provides summary statistics, supports report filtering, and allows data export in CSV format. Built-in diagnostics verify the availability of required libraries, memory and disk space, as well as the correct operation of agents and server rules.
The module provides an API and command-line interface commands for integration with external systems.
Automatic delivery of WebP and AVIF formats
The component automatically substitutes modern image formats using the picture tag and the image-set CSS function. Original files are retained as fallback options for browsers that do not support these new formats.
For Apache servers, the delivery rule is configured via the module interface. For Nginx and the BitrixVM platform, a ready-made configuration snippet is provided, which the administrator adds to the server settings after verification. The module does not automatically modify the Nginx configuration.
If a modern version of the image has not yet been created, delayed generation can be enabled. The file is placed in a queue, and a background agent generates the WebP or AVIF versions.
Data security and recovery
Before mass conversion, it is recommended to enable original file preservation and create a full site backup.
The module supports the following capabilities:
- Saving original files with the .orig extension;
- Creating versioned recovery points for each run;
- Verifying the integrity of saved snapshots;
- Performing full or selective rollback of changes;
- Retrying the recovery of files temporarily blocked by the system;
- Limiting the number and total volume of recovery points;
- Checking available disk space before creating a backup copy.
The module safely removes derived WebP and AVIF formats while preserving original files with the .orig extension. Image processing is performed via a temporary file with locking, followed by replacement of the original file. Upon completion, the module synchronizes the file size and dimensions in the b_file table and clears associated previews when required.
Management is accessible via the Services → Image Optimization section in the admin panel. Additional settings are available in the Settings → Product Settings → Module Settings → Image Optimization section.
When needed, General iT can implement “Image optimization”, configure the module and verify it against the current website setup.