【发布时间】:2013-12-29 21:52:54
【问题描述】:
例如,这不起作用:
convert -crop '69%x27%+3%+13%' +repage source.jpg cropped.jpg
它不会导致错误,但会忽略偏移量。 显然几何中的偏移量只能以像素为单位?
如何达到想要的效果?
【问题讨论】:
标签: image-processing imagemagick crop imagemagick-convert
例如,这不起作用:
convert -crop '69%x27%+3%+13%' +repage source.jpg cropped.jpg
它不会导致错误,但会忽略偏移量。 显然几何中的偏移量只能以像素为单位?
如何达到想要的效果?
【问题讨论】:
标签: image-processing imagemagick crop imagemagick-convert
你可以这样做:
convert -crop $(convert source.jpg -format "%[fx:int(w*0.69)]x%[fx:int(h*0.27)]+%[fx:int(0.03*w)]+%[fx:int(0.13*h)]" info:) +repage source.jpg cropped.jpg
尝试单独运行$() 中的部分,看看它如何生成外部命令所需的内容...
convert source.jpg -format "%[fx:int(w*0.69)]x%[fx:int(h*0.27)]+%[fx:int(0.03*w)]+%[fx:int(0.13*h)]" info:
如果我在 100x100 像素的图像上运行该部分命令,我会得到这个
69x27+3+13
【讨论】: