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 or mask it in cercle 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
cercle crop or masking through imaghmagick.......
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: cercle crop or masking through imaghmagick.......
To crop a circle you must create a circle mask, to make parts of your original image transparent.
See IM exmaples, Channels and Masking
See IM exmaples, Channels and Masking
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: cercle crop or masking through imaghmagick.......
One way I have done it:
http://www.rubblewebs.co.uk/imagemagick ... =round.jpg
Code: Select all
<?php
exec("convert -size 400x300 xc:white -fill orange -draw \"circle 200,150 200,3\" \\
-gaussian 1x1 -transparent orange mask.png");
exec("convert ../original_images/sunflower.jpg mask.png -composite round.jpg");
unlink( 'mask.png' );
?>