Glimpse makes images smaller from your terminal, CI, or application code. Start with the CLI. You do not need an account or a token of your own: image commands use a built-in public token.
Install cpx, then optimize an image:
cpx alias mathiasgrimm/glimpse-cli glimpse
cpx glimpse optimize photo.jpg --output=photo-optimized.jpg
The CLI saves the result for you. To use Glimpse from your application, see the PHP SDK or API Reference. Those require your own token.
Every operation is a simple JSON request: convert, optimize, resize, thumbnail, analyze, or inspect. You do not need to install ImageMagick, libvips, or any other image tool on your machines.
We recommend AVIF as the target format. It makes the smallest files at the same visual quality, so the examples in these docs use it first.
Where to start
- Getting Started: optimize your first image with the CLI.
- Add Glimpse to Your Project: install, baseline, and a CI gate for an existing repo.
- Supported Formats: what goes in, what comes out, and why we like AVIF.
- Quality Scale: what
quality: 85really means. - Guides: one page per operation, from convert to usage.
- API Reference: every endpoint, parameter, and response schema.
- Authentication: tokens for the SDK, API, and higher CLI limits.
Tooling
You do not have to write the HTTP calls yourself:
- CLI: the
glimpsecommand for your terminal, scripts, and CI. - PHP SDK:
mathiasgrimm/glimpse-php, one method per operation, typed results.
How Glimpse behaves
- Stateless. One request in, one image out. We store nothing on our side.
- Safe by default. The optimizer never makes a file bigger, and resize never upscales.
- We trust the bytes, not the name. The input format is detected from the real image bytes, never from a filename or from what the client says it is.