Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Irregular or non-rectangular crop

Help
2012-04-06
2013-03-27
  • Muhammad Ali
    Muhammad Ali
    2012-04-06

    Hi,

    Extremely new to graphicsmagick. I would like to use the Magick++ api to do a non-rectangular or polygon based crop.

    Is this possible? How do I go about it?

    Thanks!

     
  • Images are always rectangular for any image format.  The best you can do is so set the pixels you don't want to see to transparent (opacity set to MaxRGB).  This could be done via setting a color to transparent, flood-fill with a transparent color, or composition of the opacity channel via the CopyOpacity operator.  It may be that composition using the 'In' operator might be used.

    There are other people who are much better at knowing how to use the software to do interesting things.  I only maintain/modify the source code. :-)

     
  • Muhammad Ali
    Muhammad Ali
    2012-04-08

    So, let's say I have to do a triangular image (or any other polygon). Then how do I flood-fill the area that is not inside the triangle?