Glimpse

Glimpse Documentation

Optimize images with the CLI, no account or token needed.

On this page 3

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:

bash
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

Tooling

You do not have to write the HTTP calls yourself:

  • CLI: the glimpse command 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.