CLI ImageMagick resize (downscale only)
I would like to resize (only if neccessary) an image to maximum resolution of 800x600. So let's say we have image of resolution 2000x1600 and it will resize to 750x60开发者_运维百科0, but if I have an image of resolution 400x300 it will leave as it is. In other words I need ImageMagick to resize images without upscaling. How can I do this?
convert -resize 800x600 input output
does downscale but also upscale.
Solved it: convert -resize 800x600\> input output
will resize only if width is larger than 800px OR height is larger than 600px.
if you want to resize the current file try mogrify -resize 800x600\> *.jpg
this will resize all jpg images with more than 800 pixels width or 600 height.
精彩评论