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 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.
Spatie Image provides an expressive API to manipulate images. It perfectly aligns with Laravel's mission, which is to create the best developer experience.
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.