Page 1 of 1

Problem setting background color for wave image operation

Posted: 2007-12-13T11:58:16-07:00
by SkipperMcNally
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.

Re: Problem setting background color for wave image operation

Posted: 2007-12-13T12:24:15-07:00
by SkipperMcNally
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);