Crop image to biggest centred part with a ratio [closed]

泄露秘密 提交于 2019-12-25 07:47:08

问题


I would like to crop image to a radio, 4:3 for instance.

But I would like the biggest centred part, for instance :

to

to

I didn't find my situation in the imagemagick documentation.

(Imgur sizes are quite inacurate but you should get the idea)


回答1:


Finally I wrote a little script for me: reduce-ration (it requires ruby with the fastimage gem: gem install fastimage)

In my example: reduce-maxi 4x3 center shutup.png templerun.jpg

You can use it like: reduce-maxi RATIO DIRECTION IMAGES.... See the gist for more details.

I also wrote a script to get the ratio of the images. See the gist.



来源:https://stackoverflow.com/questions/14916635/crop-image-to-biggest-centred-part-with-a-ratio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!