I’m using ImageMagick to get 3 versions of an uploaded picture.
The problem is that the 3 new pictures aren’t optimized for web like Save For Web & Devices in Photoshop. The difference is big. ImageMagick generates files which are 5 times bigger than a web-optimized picture from Photoshop.
Can you help me to improve this issue?
This is the ImageMagick-Part:
exec($imageMagickPath." uploads/foto.jpg -resize 514x uploads/fl-foto.jpg");
exec($imageMagickPath." uploads/fl-foto.jpg -resize 320x320 uploads/hl-foto.jpg");
exec($imageMagickPath." uploads/fl-foto.jpg -resize x96 -gravity center -crop 96x96+0+0 +repage uploads/th-foto.jpg");
Of course, I want to use these 3 images on the front-end, but they are to big and slow down the entire page.
Any suggestions?
Imagemagick uses the parameter
-quality #to set the desired quality, by which you can decrease your image-size by increasing compression. You can read more about it at their documentation. The section about jpeg says this:In your case this would become: