New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

mathiasgrimm/glimpse-php

PHP SDK for glimpseimg.com: convert, optimize, resize, thumbnail and analyze images.
1,689
Install
composer require mathiasgrimm/glimpse-php
Latest Version:v3.3.2
PHP:^8.2
Laravel:10 – 13
License:MIT
Last Updated:Sep 12, 2026
Links: GitHub  ·  Packagist
Maintainer: mathiasgrimm

glimpse: ship smaller images, skip the toolchain

Ship smaller images. Skip the toolchain.
Convert, optimize, resize, thumbnail and analyze images from any PHP application.
The official PHP SDK for glimpseimg.com, the image API for developers.

Latest Version on Packagist Tests Total Downloads PHP Version License


Shipping images means wrangling ImageMagick, libvips, mozjpeg, cwebp and avifenc: compiled binaries that differ between your laptop, your teammate's laptop, and production. glimpse-php replaces all of them with one method call, with zero binary dependencies. The heavy lifting happens on the Glimpse API: stateless, nothing stored, your bytes never linger. You require a single package and go:

composer require mathiasgrimm/glimpse-php
use MathiasGrimm\GlimpsePhp\Glimpse;

$glimpse = Glimpse::createClient('YOUR_TOKEN');

$result = $glimpse->optimize(file_get_contents('photo.jpg'));
file_put_contents('photo-optimized.jpg', $result->bytes);

That is the whole integration: no extensions to compile, no binaries to pin, no queue of shell-outs to babysit. Every method returns typed, immutable results.

Documentation

The full documentation lives at glimpseimg.com/docs/sdk:

  • Installation: requirements and optional extensions.
  • Authentication: building the client and verifying tokens.
  • Methods: every method and the typed objects it returns.
  • Laravel: container wiring and Http::fake() in tests.
  • Errors: the exception hierarchy.

Upgrading from v1? The upgrade guide covers the move from array returns to typed objects.

Development

composer install
composer test        # Pint (check), PHPStan, and the Pest suite

Releasing

make release VERSION=vX.Y.Z

Runs the test suite, tags VERSION, pushes the tag, and creates the GitHub release. Packagist picks the new tag up through the GitHub webhook.

License

glimpse-php is open-source software licensed under the MIT license.


Prefer the terminal? glimpse-cli is the first-party CLI: the same API from your shell and CI, no PHP code required.
Grab a free API key at glimpseimg.com (Settings → API Tokens).

Related Packages

mathiasgrimm/glimpse-cli

Convert, optimize, resize, thumbnail and analyze images from your terminal. The...

3,914 0
phpsamurai/image-conversion

A simple laravel package for converting media images to WebP format

6 1
emanuelzh/loptimizer

Image optimizer v2 for laravel

15 0
intervention/image

PHP Image Processing

238,211,497 14,380
intervention/image-laravel

Laravel Integration of Intervention Image

13,560,589 161

Version History

Version Released PHP Laravel License
v3.3.2 ^8.2 ^10.0|^11.0|^12.0|^13.0 MIT
v3.3.1 ^8.2 ^10.0|^11.0|^12.0|^13.0 MIT
v3.3.0 ^8.2 ^10.0|^11.0|^12.0|^13.0 MIT
v3.2.0 ^8.2 ^10.0|^11.0|^12.0|^13.0 MIT
v3.1.0 ^8.2 ^10.0|^11.0|^12.0|^13.0 MIT