ImageMagick - 调整到最大宽度
我想将图像大小调整为最大宽度
。所以我不关心图像的高度,但我只想始终将其大小调整为特定的宽度。
我确信我以前做过这个,只是现在不记得我是怎么做到的了。
I want to resize an image to a max width
. So I don't care about the height of the image, but I just want to always resize it to a specific width.
I'm certain I've done this before I just can't remember how I did it now.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
似乎这就是完成的方式,请注意宽度是第一个参数。
对于其他想知道身高的人,那么您可以这样做:
来源:http:// www.imagemagick.org/script/command-line-processing.php
编辑(2014 年 11 月): 请注意,在最新版本的 ImageMagick 中,您不能再在值周围使用引号,因为根据凯文拉贝科特的评论。
Seems this is the way it is done, noting that width is the first parameter.
For anyone else wondering about height, then you would do this:
Source: http://www.imagemagick.org/script/command-line-processing.php
Edit (Nov 2014): Note that in the latest versions of ImageMagick you can no longer use quotes around the values as per Kevin Labécot's comment.
你的问题含糊不清。您的标题要求将图像大小调整为最大宽度,但您似乎说要将图像大小调整为特定宽度。
如果您想将某些内容的最大宽度调整为 600 像素(即,任何宽度小于 600 像素的图像都不会受到影响),请使用:
或者,直接修改原始图像:
如果您想要最大高度而不是最大宽度:
Your question is ambiguous. Your titles asks to resize an image to a max width, but then you seem to say you want to resize the image to a specific width.
If you want to resize something to a max width of 600px (ie, any image with a width of less than 600px will be unaffected), use:
Or, to directly modify the original image:
If you'd like max height rather than max width:
您只是通过数学来计算出正确的宽高比吗?
Are you just chasing the math to work out the correct aspect ratio?
在 ImageMagick 中调整大小到给定宽度的方法是:
or just
where W=width and is provided, but H=height is not included
参见 https://imagemagick .org/script/command-line-processing.php#geometry
The way to resize to a given width in ImageMagick is:
or just
where W=width and is provided, but H=height is not included
See https://imagemagick.org/script/command-line-processing.php#geometry