Crop with Gravity

Magick++ is an object-oriented C++ interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick++.
Post Reply
pavitra
Posts: 1
Joined: 2015-10-01T02:59:16-07:00
Authentication code: 1151

Crop with Gravity

Post by pavitra »

How do I get below command line convert uisng magick++ apis?

convert image.png -gravity center -crop 1500x900+0+0 element.png

Basically want a section of image from its center. I couldn't find any method to set gravity or a crop() which uses gravity option.

UPDATE:
One way to do this is specify the offset values in Geometry, but for that I need resolution of input image. In above eg, width and height of image.png. I didn't find any getters for these in the docs, like getImageGeometry(). Can I get some pointers in this direction?
Post Reply