IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
SkipperMcNally
Post
by SkipperMcNally » 2007-12-13T11:58:16-07:00
I have trying to apply a wave operation on an image and have the added areas be transparent and having no luck. Any suggestions?
Here is the code:
Code: Select all
$testImagick = new Imagick("input.jpg");
$testImagick->setImageFormat("png");
$testImagick->setBackgroundColor(new ImagickPixel("transparent"));
$testImagick->waveImage(20, $testImagick->getImageWidth() * 2);
The added area is always white, even when I try blank and Red as colors.
Thanks for any help.
SkipperMcNally
Post
by SkipperMcNally » 2007-12-13T12:24:15-07:00
Nevermind, I found this old bug report thread that told me I should be using setImageBackgroundColor() instead.
Thread:
http://pecl.php.net/bugs/bug.php?id=12444
Working code:
Code: Select all
$testImagick = new Imagick("input.jpg");
$testImagick->setImageFormat("png");
$testImagick->setImageBackgroundColor(new ImagickPixel("transparent"));
$testImagick->waveImage(20, $testImagick->getImageWidth() * 2);