Using ImageMagick, I'm trying to resize a JPEG's dimensions and reduce the file size.
The issue is that I don't want to worsen the image quality.
I've tried the following commands:
convert -resize 170x80 -resample 100x100 image1.jpg image2.jpg
=> A resized picture but with bad quality.
convert -resize 170x80 -quality JPEG image1.jpg image2.jpg
=> A resized image and with good quality, but the same file size.
convert -density 600 -resize 170x80 image1.jpg image2.jpg
=> A resized image but very bad quality.
I don't know what option I should use.
I've managed to solve this issue using convert
and mogrify
:
convert -flatten -colorspace RGB myImage.jpg myImage.jpg
&&
mogrify -quality JPEG -geometry 170x80 myImage.jpg