Laravel Image Quality

Tags: , ,

Every time I upload a new image to my server, this image is resized. The main issue I’m having is that the image is losing a lot of quality. This is the current code:

    $name1 = str_random(10);
    $img = Image::make($img1);
    $img->resize(270,152, function ($constraint) {$constraint->aspectRatio();});
    $img->crop(160, 132, 55, 0);
    $img->save('/imagenes/'.$name1.'.jpg', 100);
    $escena->img1_plx = $name1.'.jpg';

I tried with different changes but the image still lose many quality


You can try a new library: Intervention Image

Here is the link: Intervention Image

You can choose format, dimensions, crop and quality for the images.

Source: stackoverflow