Rotating PNG losing transparency

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
snuble

Rotating PNG losing transparency

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

Re: Rotating PNG losing transparency

Post 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
Post Reply