Round crop using imagemagic

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
soumya007

Round crop using imagemagic

Post by soumya007 »

Hello all,

I'm trying to crop an image using imagemagic and I have done it successfully in general way. But now i'm trying to crop it in round shape. I have tried many things but didn't find any luck.

If you guyz have any idea then please help me out. This is very urgent for me.

Thanks in advance

Regards - Soumya

P.S: You can also write to me at soumyajit.soumya@gmail.com
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Round crop using imagemagic

Post by anthony »

You either mask, the image or compose it against a circle shape on a transparent background. Both are covered by Channles and Masking in IM examples.
http://imagemagick.org/Usage/channels/

EDIT: the above link has been fixed.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
jokepondy

Re: Round crop using imagemagic

Post by jokepondy »

Hello Sowmya

$samp7 = "images/test1.jpg";
$samp101 = "images/circles.gif";

exec("convert $samp7 \( +clone -threshold -1 -negate -fill white -draw \"circle 64,64 64,0\" \) -alpha off -compose copy_opacity -composite $samp101");

Hope this will help for you ..try this.

Regards

John kennedy.s
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Round crop using imagemagic

Post by fmw42 »

Post Reply