mathiasgrimm/glimpse-php

PHP SDK for glimpseimg.com: convert, optimize, resize, thumbnail and analyze images.
1,618
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

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.


Related Packages

mathiasgrimm/glimpse-cli

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

3,133 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

231,141,441 14,375

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