Convert, optimize, resize, thumbnail and analyze images through one authenticated JSON API, or a CLI with zero binary dependencies. No ImageMagick, no libvips, no encoder builds.
No credit card required to start.
$ composer global require mathiasgrimm/glimpse-cli $ glimpse auth $ glimpse convert banner.png --format=avif --optimize
✓ banner.avif written (image/avif) 360.3 KB → 24.2 KB
Six reasons to put glimpse in your stack.
Encoding runs on our side. The CLI needs nothing beyond PHP, so you get identical results on macOS, Linux and CI.
Ship AVIF and WebP without compiling libheif or aom. JPG, PNG and GIF come out of the same request.
analyze predicts the size of every output format before you commit, for one file or a whole directory.
check fails the build when an image would shrink past your threshold, so bloat never reaches production.
Optimized output is never larger than the input, resize never upscales, and nothing is overwritten without --force.
One request in, one image out. Nothing is stored on our side and every request is authenticated with a bearer token.
One JSON request. Copy, paste, ship.
Send a JSON body with the base64-encoded source and the target format. glimpse verifies the source type from the actual bytes, re-encodes it, and returns the result base64-encoded in data.output.data.
Or skip the plumbing entirely: mathiasgrimm/glimpse-php is the official PHP SDK. One typed method per endpoint, with the base64 encoding and authentication handled for you.
// composer require mathiasgrimm/glimpse-php use MathiasGrimm\GlimpsePhp\Client; use MathiasGrimm\GlimpsePhp\ImageFormat; use Illuminate\Http\Client\Factory; $glimpse = new Client(new Factory, getenv('GLIMPSE_TOKEN')); $result = $glimpse->convert( file_get_contents('photo.png'), ImageFormat::Avif, optimize: true, ); file_put_contents('photo.avif', $result->bytes);
The same API, from your terminal.
glimpse is the first-party CLI, available on GitHub as mathiasgrimm/glimpse-cli. A self-updating PHAR with zero binary dependencies: it handles file reading, base64 encoding, authentication and output files for you.
glimpse auth, then point it at files $ glimpse thumbnail photo.jpg --width=150 --quality=50 ✓ photo.thumb.jpg written (image/jpeg) $ glimpse info photo.jpg --json | jq .format "jpg" $ cat photo.png | glimpse convert - --format=avif -o photo.avif $ glimpse thumbnail photo.jpg --output=- | imgcat
One package, no extensions to compile.
A single self-contained binary. No Composer needed.
The PHAR updates itself in place.
See the savings before you touch a file.
glimpse analyze predicts the converted size of every output format, for a single file or a whole directory tree, and shows you exactly where the savings are. Nothing is uploaded: your files never leave your machine.
--json for scripts, .glimpseignore to skip vendored assets $ glimpse analyze assets/ --optimize banner.png 360.3 KB avif 40.5 KB -88.7% webp 81.1 KB -77.5% jpg 145.9 KB -59.5% hero.jpg 512.8 KB avif 61.5 KB -88.0% webp 98.3 KB -80.8%
Fail the build, not your users.
glimpse check scans a directory and exits non-zero when any image would shrink past your threshold. Wire it into GitHub Actions and unoptimized images never merge again.
--threshold=25.glimpseignore keeps vendored and generated assets out of the scan name: Glimpse on: push: branches: [main] pull_request: permissions: contents: read jobs: check-images: runs-on: ubuntu-latest env: # Optional. Without it (for example on fork pull requests, which # never receive secrets) the CLI uses its built-in public token, # which only allows check and analyze and shares rate limits. GLIMPSE_TOKEN: ${{ secrets.GLIMPSE_TOKEN }} steps: - uses: actions/checkout@v6 - name: Install glimpse run: | composer global require --no-interaction --no-progress mathiasgrimm/glimpse-cli composer global config bin-dir --absolute --quiet >> "$GITHUB_PATH" - name: Check images run: glimpse check .