Page 1 of 1

Align shapes with bottom of image

Posted: 2012-09-30T08:20:42-07:00
by rssjm
I would like to be able to align all shapes within an image to the bottom of it. The images below show what I am trying to achieve with before/after. I was working with the -gravity option but I just wasn't able to get them to drop vertically. Any tips or general idea of how I would go about this is much appreciated.

Image

Image

Re: Align shapes with bottom of image

Posted: 2012-09-30T10:53:26-07:00
by fmw42
see
http://www.imagemagick.org/Usage/layers/#convert

Use -gravity and -geometry. You can use -gravity south to place them at the bottom center and then use -geometry to offset them as desired.

This assumes you have each shape as a separate image. If not then use my (unix bash) script, separate, to separate them into individual shapes and then follow up as above.

Re: Align shapes with bottom of image

Posted: 2012-09-30T15:36:15-07:00
by rssjm
Thanks for the tips Fred, I actually used another thread to start my search that you gave great information in but wasn't able to cross this final bridge. Could you please specify which script you are talking about. Thanks!

Re: Align shapes with bottom of image

Posted: 2012-09-30T17:44:42-07:00
by fmw42
My "separate" script is listed at the link below. That will allow you to automatically crop out each of the shapes. You may have to negate the image so that the shapes are white on black. Then once separate, you will then need to negate them back. You probably will then need to use -trim +repage to get them cropped to the minimum bounding boxes.