Intervention Image Laravel lose image quality while resizing it

Viewed 52

below is my code for resize image using laravel image intervention,

$photo='original image path' // this image is 10kx10k and size is 10 mb
$widthMedium = 1000;
$heightMedium = 1000;

$imgMedium  = Image::make($photo)->resize($widthMedium, $heightMedium, function ($constraint) {
   $constraint->aspectRatio();
   $constraint->upsize();
})->encode($extension, 100);

Storage::put('path to store resized image', $imgMedium, 'public'); // now i got 1kx1k image resize in folder but it's just around 100kb with bad quality
0 Answers
Related