Top Laravel Image Processing Packages

Image processing is a common task in a web application. When a user uploads an image to our server, we do not store the raw file due to performance issues. Loading a large raw file can slow down a website's speed. What we usually do is resize the raw file to the ideal size and compress the image to reduce its file size.

In Laravel, three major packages can help archive image processing jobs. In this post, we share them.

Intervention Image

Intervention Image is an open-source PHP image handling and manipulation library. It provides an easier and more expressive way to create, edit, and compose images and supports currently the two most common image processing libraries GD Library and Imagick. And it provides an official Laravel integration.

  • Documentation: https://image.intervention.io/v2/introduction/installation#integration-in-laravel
  • Download: https://github.com/Intervention/image

Spatie Image

Spatie Image provides an expressive API to manipulate images. It perfectly aligns with Laravel's mission, which is to create the best developer experience.

  • Documentation: https://freek.dev/684-a-package-to-easily-manipulate-images-in-php
  • Download: https://github.com/spatie/image

Laravel Glide

Glide is a wonderfully easy on-demand image manipulation library written in PHP. Its straightforward API is exposed via HTTP, similar to cloud image processing services like Imgix and Cloudinary.

Laravel Glide is a wrapper for Laravel. Under the hood, it leverages Glide to perform the manipulations.

  • Documentation: https://glide.thephpleague.com/1.0/api/quick-reference/
  • Download: https://github.com/spatie/laravel-glide