【发布时间】:2011-09-10 01:28:51
【问题描述】:
使用 Imagemagick,我想 convert 将一批 PNG 转换为 1080 像素的固定高度和 成比例的宽度。 proportional 我的意思是:如果原图缩小 16.8% 到 1080px,宽度也需要缩小 16.8%。
任何使用 convert 的方式,而不必在之前计算精确的几何图形(使用 identify 和一些 bash 计算恶作剧)?
【问题讨论】:
标签: imagemagick image
使用 Imagemagick,我想 convert 将一批 PNG 转换为 1080 像素的固定高度和 成比例的宽度。 proportional 我的意思是:如果原图缩小 16.8% 到 1080px,宽度也需要缩小 16.8%。
任何使用 convert 的方式,而不必在之前计算精确的几何图形(使用 identify 和一些 bash 计算恶作剧)?
【问题讨论】:
标签: imagemagick image
还有一个例子。给它一些调整大小参数的值,它会自动调整你的图像大小。此外,您还可以选择其他参数(重心或裁剪等)。
convert image_example: \
-resize x160 -resize '160x<' -resize 50% \
-gravity center -crop 80x80+0+0 +repage image_example.jpg
干杯
【讨论】:
Image geometry 是一个描述为与-resize 一起使用的选项
xheight Height given, width automagically selected to preserve aspect ratio.
所以你只需要指定高度
【讨论】:
试试这个:
convert -resize x1080 {from_path} {to_path}
【讨论】: