Download the PHP package uxcode-fr/image-optimizer without Composer

On this page you can find all versions of the php package uxcode-fr/image-optimizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package image-optimizer

Image Optimizer

Converts PNG/JPG images to AVIF, WebP and JPG in multiple sizes.

Works with Laravel, Symfony, and vanilla PHP projects.

Screenshot


Why use it?

Modern web performance starts with images. They typically account for 50–80% of a page's total weight — and they are the first thing Lighthouse, PageSpeed Insights, and Core Web Vitals will flag.

Next-gen formats

AVIF and WebP deliver the same visual quality as JPEG at a fraction of the size:

Format Typical size vs JPG
JPG baseline
WebP ~30% smaller
AVIF ~50% smaller

The browser automatically picks the best format it supports via <picture> / srcset. JPG is kept as a universal fallback.

Responsive images & HiDPI

Serving a 1200px image on a 300px thumbnail wastes bandwidth and slows down the page. With this tool you define the exact widths you need per image category, and @2x / @3x variants are generated automatically for Retina and HiDPI screens — so every device downloads only what it needs.

PageSpeed & Lighthouse impact

Optimizing images directly improves the metrics that matter most:

Build-time, zero runtime cost

Images are generated once at build time — no on-the-fly processing, no extra server load, no CDN dependency. The output is plain static files you deploy like any other asset.


Prerequisites

Requires the PHP Imagick extension on your system.


Installation


Configuration

Laravel

Symfony / vanilla PHP

config/image-optimizer.php

Via composer.json (fallback)


Usage

Output example


HTML usage examples

<picture> with multiple formats and sizes

The browser picks the first <source> it supports, from top to bottom — AVIF first, then WebP, then JPG as a universal fallback.

Simple srcset (single format, multiple widths)

Avatar (fixed size, HiDPI only)

Laravel Blade


Configuration options

Key Default Description
source resources/images Source folder (PNG/JPG), relative to project root
destination public/img Output folder, relative to project root
quality ['avif'=>60, 'webp'=>82, 'jpg'=>85] Compression quality per format (1–100)
formats ['avif', 'webp', 'jpg'] Output formats — any subset of avif, webp, jpg
densities [1, 2] Pixel density multipliers (1 = base, 2 = @2x…)
folders [] Per-folder width list (null = convert only)

Obsolete image cleanup

Pass --clean to delete generated files that no longer have a matching source image (only for folders declared in folders).


License

MIT — Copyright 2026 uxcode.fr


All versions of image-optimizer with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
ext-imagick Version *
composer-runtime-api Version ^2.0
symfony/console Version >=6.0
symfony/finder Version >=6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package uxcode-fr/image-optimizer contains the following files

Loading the files please wait ...