A PHP library for optimizing PNG, JPG, GIF, and SVG images using command-line tools like optipng, pngquant, jpegoptim, and svgo.
Image Optimizer is a PHP library that compresses image files (PNG, JPG, GIF, SVG) by leveraging command-line tools like optipng, pngquant, jpegoptim, and svgo. It reduces image sizes by 10%-70% to improve web performance and storage efficiency. The library provides a simple API to optimize images either in place or to custom output paths.
PHP developers building web applications that handle user-uploaded images or need to optimize static assets for faster page loads.
Developers choose Image Optimizer because it unifies multiple proven optimization tools into a single, configurable PHP interface, eliminating the need to manually call command-line binaries. Its smart format detection and error-handling options make it robust for production use.
Image optimization / compression library. This library is able to optimize png, jpg and gif files in very easy and handy way. It uses optipng, pngquant, pngcrush, pngout, gifsicle, jpegoptim and jpegtran tools.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Handles PNG, JPG, GIF, and SVG by leveraging specialized tools like pngquant for lossy PNG optimization and svgo for SVG, ensuring format-specific efficiency.
Automatically detects file types and applies the best optimization chain, reducing manual configuration overhead, as shown in the default 'smart' optimizer.
Configurable with ignore_errors option to prevent upload failures or throw exceptions for strict validation, making it robust for production use.
Allows overriding binary paths, passing custom arguments to each optimizer, and adding custom optimizers via configuration, as detailed in the options list.
Requires manual installation of multiple command-line tools like optipng and jpegoptim, which adds setup complexity and may fail in restricted environments.
Operates only on file paths, lacking support for in-memory streams or direct handling of uploaded data without intermediate storage, limiting integration flexibility.
Focuses exclusively on compression, so additional libraries are needed for tasks like resizing or cropping, unlike comprehensive image processing suites.