问题
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