php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57912 Cannot set background color for waveImage
Submitted: 2007-11-14 10:42 UTC Modified: 2007-11-14 10:47 UTC
From: sleeperseven at hotmail dot com Assigned:
Status: Closed Package: imagick (PECL)
PHP Version: 5.2.1 OS: Linux
Private report: No CVE-ID: None
 [2007-11-14 10:42 UTC] sleeperseven at hotmail dot com
Description:
------------
Using Imagick 2.0.1 compiled against ImageMagick 6.3.6-9 on PHP 5.2.4/Linux.

When using Imagick, setting an image's background color to transparent before invoking waveImage should affect the color of the wave background.  Instead, the wave background is white.  When invoked from the command-line (using "convert") or when invoked using MagickWand for PHP, the wave background is correctly set to transparent.

Reproduce code:
---------------
$hImg = new Imagick();
$hImg->newImage(100, 100, new ImagickPixel("orange"));
$hImg->setBackgroundColor(new ImagickPixel("transparent"));
$hImg->waveImage(15, 200);
$hImg->trimImage(0);
$hImg->setImageFormat("png32");
header("Content-Type: image/png");
echo $hImg;
exit;

Expected result:
----------------
If browser background is set to non-white, the top meniscus and bottom corners should be the same color as the browser canvas.

Using MagickWand, the correct output can be obtained with the following code:

$hImg = NewMagickWand();
MagickNewImage($hImg, 100, 100, "orange");
MagickSetImageBackgroundColor($hImg, "transparent");
MagickWaveImage($hImg, 15, 200);
MagickTrimImage($hImg, 0);
MagickSetImageFormat($hImg, "png32");
header("Content-Type: image/png");
echo MagickGetImageBlob($hImg);
exit;


Actual result:
--------------
Top meniscus and bottom corners are white rather than transparent.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-14 10:47 UTC] mkoppanen@php.net
Thank you for taking the time to write to us, but this is not
a bug.

Replace setBackgroundColor with setImageBackgroundColor and retry.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 10:01:28 2024 UTC