Member-only story
Image Optimization in Laravel
Optimization made easy
Measuring performance are major steps need to consider in software development. To increase the performance — Optimization are important. Optimization means downsizing the media files but maintaining a satisfactory level of visual quality for delivery. So to provide a fast page load it is best to make those media files as small as they can be. The less bytes the browser needs to download the faster the page will be.
Here is where Laravel image optimizer developed by Spatie comes in handy. This package make images as small as they can be with these tools — such as jpegtran
, pngquant
, and gifsicle
. In most cases these tools can make your images considerably smaller without you noticing, unless you have a trained eye for that.
Let’s get started
Install laravel image optimizer package by running below command in terminal
> composer require spatie/laravel-image-optimizer
This package uses a bunch of binaries to optimize images as mention. You may need to configure each of the binary and must be present in your system. Here is the list of optimizer binaries available: —