Transparency and PNG

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.
Post Reply
Excale
Posts: 13
Joined: 2010-12-05T23:39:53-07:00
Authentication code: 8675308

Transparency and PNG

Post by Excale »

Hi,

I'm trying to convert PNG and GIF files using Imagick.

Here is my code:

Code: Select all

try {
$thumb4 = new Imagick($name . '.' . $extension_upload);
$thumb4->setImageOpacity(1.0);
$thumb4->resizeImage(318,212,Imagick::FILTER_LANCZOS,1);
$thumb4->writeImage($name . '.' . "bmp");
$thumb4->destroy(); 
} catch (Exception $e) {
    echo '<br />Corrupt file!';
}
I have a problem with PNG and GIF files. Most of the times, transparency is convert in blue (or an over color).
Why blue?

How can I convert transparency in white?

Thank you for your help :D .
Excale
Posts: 13
Joined: 2010-12-05T23:39:53-07:00
Authentication code: 8675308

Re: Transparency and PNG

Post by Excale »

Can someone help me please :) ?
Post Reply