# spatie/laravel-image-optimizer

Optimize images in your Laravel app

Repository: https://github.com/spatie/laravel-image-optimizer
Canonical: https://ross.abutalabs.com/products/laravel-image-optimizer
Homepage: https://spatie.be/opensource/laravel
Language: PHP
License: MIT
License Family: permissive
Topics: laravel, php, image, optimize, performance
Last push: 2026-08-07T11:20:47+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 96, release rhythm 39, longevity 100
- inputs: {"age_days": 3344, "days_push": 26, "days_rel": 193, "gap_med": 182.5, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1309, forks 117 (observed 2026-08-28T04:04:19.347792+00:00)

## What it is
A Laravel package that optimizes PNG, JPG, SVG, and GIF images by running them through a chain of installed optimization binaries. It is the Laravel integration of spatie/image-optimizer and includes a facade, container binding, and middleware for automatic optimization.

## Use cases
- optimize images in a laravel app
- compress pngs and jpgs on upload
- reduce image file sizes for faster page loads
- automatically optimize images served via middleware
- shrink svg and gif files in php
- integrate image optimization into laravel media uploads

## When to choose
- you use Laravel and want drop-in image optimization
- you want to leverage system-installed optimizers like pngquant or jpegoptim
- you need automatic optimization of request/response images via middleware

## When to avoid
- you are not using Laravel - use spatie/image-optimizer directly
- you need pure-PHP optimization without external binaries
- you need advanced image manipulation like resizing or cropping - use spatie/image instead

## Facets
- artifact type: library
- maturity: stable
- function: image-processing, middleware, developer-tools
- domain: image-processing, web-development, performance
- platform: php
- tags: laravel-package, image-optimization, spatie, compression, png, jpeg, svg, gif, laravel, web-server

## Member repositories
- spatie/laravel-image-optimizer (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:19.347792+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:50:01.036653+00:00, confidence not recorded.
  - readme: https://github.com/spatie/laravel-image-optimizer (fetched 2026-08-28T04:04:19.347792+00:00, sha 3577869ac6f1)
  - homepage: https://spatie.be/opensource/laravel (fetched 2026-08-29T12:08:13.353247+00:00, sha 4a0ae7f7c9b6)
  - site_page: https://spatie.be/docs (fetched 2026-08-29T12:08:13.356034+00:00, sha 08e024d86d95)
  - site_page: https://spatie.be/about-us (fetched 2026-08-29T12:08:13.357889+00:00, sha d3cb88e4b34c)
- Data as of 2026-08-30T08:39:29.467469+00:00.
