For downloading images, an extraneous library is used; the image is saved in several extensions with regard to proportions; this does not work well. But Google shows that the image can be optimized. Yes, this is true, but you cannot lose in quality at all. This library is currently used.

How to optimize the image without losing quality?

  • And what library do you have them now? - Orange_shadow
  • Actually, I do it to her, and you set the quality there when compressing? And how do you make them right away or do you still see small ones? Can Google say that why the heck are you the type of such big ones you immediately load? - Orange_shadow
  • @Orange_shadow I did not find how to specify the quality but the pictures are saved in several sizes, where I need to take out small ones. 4 more sizes and the original of the files of course, but so far so far - Shadow33
  • Reduce everything to the size that you display on the screen, if the same photo is displayed 2 times on the screen, then do it larger once, since the photo is loaded once the second time, it will not load so it’s useless and 2 times as meaningless , and for the original it is better to make a link to the original photo, well, or plug in the fancybox, though again I don’t know the specifics - Orange_shadow

1 answer 1

Standard save by this library

$img = Image::make('path/to/foo.jpg')->resize(300, 200); $img->save('path/to/bar.jpg'); 

Quality management is carried out in the function save()

 $img = Image::make('path/to/foo.jpg')->resize(300, 200); $img->save('path/to/bar.png', 60);//точнее вот тут) 

More here