How can we reduce image size i.e make it around 100kb without reducing it's quality and scale(height and width) can we do using laravel intervention? For any sample code you have, please help me.
Asked
Active
Viewed 750 times
1 Answers
0
Laravel does not natively support image optimization, but it is easy to integrate external libraries such as spatie's laravel-image-optimizer.
You can use this library by calling the optimize function.
use ImageOptimizer;
// the image will be replaced with an optimized version which should be smaller
ImageOptimizer::optimize($pathToImage);

Hedam
- 2,209
- 27
- 53