开发者

CLI ImageMagick resize (downscale only)

开发者 https://www.devze.com 2023-01-11 19:06 出处:网络
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 a

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号