Page 1 of 1

Command for rounded corners doesn't do anything.

Posted: 2009-11-16T17:20:13-07:00
by bellesebastien
Hi,
I'm trying to use ImageMagick(using PHP) to give rounded corners to my images. I've copied the code from here but it doesn't seem to do anything.

Code: Select all

$convertCommandRoundedCorners="convert ".$pathToImage." \
			     \( +clone  -threshold -1 \
			        -draw 'fill black polygon 0,0 0,15 15,0 fill white circle 15,15 15,0' \
			        \( +clone -flip \) -compose Multiply -composite \
			        \( +clone -flop \) -compose Multiply -composite \
			     \) +matte -compose CopyOpacity -composite ".$pathToNewImage;

An echo of $convertCommandRoundedCorners outputs this

Code: Select all

convert /media/catalog/5e06319eda06f020e43594a9c230972d/0/1/01.image.jpg \
			     \( +clone  -threshold -1 \
			        -draw 'fill black polygon 0,0 0,15 15,0 fill white circle 15,15 15,0' \
			        \( +clone -flip \) -compose Multiply -composite \
			        \( +clone -flop \) -compose Multiply -composite \
			     \) +matte -compose CopyOpacity -composite /media/catalog/5e06319eda06f020e43594a9c230972d/0/1/01.image2.jpg
When I run this code the image created is identical with the original except that it's a few bytes lighter.
Could anyone give me some info on what I'm doing wrong?

Thanks.

Re: Command for rounded corners doesn't do anything.

Posted: 2009-11-16T17:49:51-07:00
by fmw42
jpg does not support transparency. try saving as png or possible gif

Re: Command for rounded corners doesn't do anything.

Posted: 2009-11-16T18:07:14-07:00
by bellesebastien
I just realized that, thanks for the prompt response fmw42.