Image rotating not working with PNG alpha'd images
Posted: 2009-04-21T12:43:28-07:00
Code that used to be working is no longer probably due to an upgrade of ImageMagick. I think....
I've have code to rotate PNG alpha transparency images. Where it used to correctly leave the excess 'new' areas transparent, it now leaves them as solid black. This picture would be the best example. I'm rotating two images and compositing them on a third red image.
Both images have an alpha mask as you can see. The output image is png as well. I'm using the following code:
If I do a...
... right after the MagickRotateImage, I get the same black areas. So I know it's not a fault of my composite options.
Might anyone have an idea what could be causing this new problem?
Thanks!
I've have code to rotate PNG alpha transparency images. Where it used to correctly leave the excess 'new' areas transparent, it now leaves them as solid black. This picture would be the best example. I'm rotating two images and compositing them on a third red image.
Both images have an alpha mask as you can see. The output image is png as well. I'm using the following code:
Code: Select all
MagickReadImage($wnd, $file);
MagickSetImageFormat($wnd, "png");
MagickSetImageType($wnd, MW_TrueColorMatteType);
$transparentColor = NewPixelWand();
PixelSetColor($transparentColor, "none");
MagickSetImageBackgroundColor($wnd, $transparentColor);
MagickRotateImage($wnd, $transparentColor, $rotation);
Code: Select all
MagickWriteImage($wnd, "/usr/web/styleFlipGraphics/exports/thumb/test.png");
Might anyone have an idea what could be causing this new problem?
Thanks!