Command for rounded corners doesn't do anything.

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
bellesebastien

Command for rounded corners doesn't do anything.

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post by fmw42 »

jpg does not support transparency. try saving as png or possible gif
bellesebastien

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

Post by bellesebastien »

I just realized that, thanks for the prompt response fmw42.
Post Reply