Page 1 of 1

Rotating PNG losing transparency

Posted: 2010-01-20T04:01:25-07:00
by snuble
Using command line tools, convert version 6.5.4 (fedora 12): convert someimage.png -background transparent -rotate -8.85795876362829 result.png
This results in a distorted image with black background instead of transparency.

On another machine I have version 6.5.1 (fedora 11) and here the command results in the wanted transparent background and no distortion of the image.

This also happens if I create the "someimage.png" with
convert -border 100 -bordercolor none -background transparent -pointsize 144 -gravity "West" -fill "#ff0000" -stroke "#000000" -strokewidth 2 -font myfont.ttf label:"\nHello World" tmp.png
convert tmp.png -trim +repage someimage.png
convert someimage.png -background transparent -rotate -45 result.png

Any hints on what I can do diffrent, or if this is a bug in the version of Image Magick Fedora 12 is using?

Re: Rotating PNG losing transparency

Posted: 2010-01-20T10:52:21-07:00
by fmw42
convert someimage.png -background transparent -rotate 20 result.png
works just fine on my IM 6.5.9-0 Q16 Mac OSX Tiger. I suspect you just have a bug in the one version/platform. Perhaps you might try upgrading or reinstalling.

You could try
convert someimage.png -channel rgba -matte -background transparent -rotate 20 result.png

and see if that helps