We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

GD resize() transparent png images

When I resize images using the built in GD library resize(), the transparancy becomes a black background. How can I keep the transparency?

$image = new Phalcon\Image\Adapter\GD("upload/test.jpg");
$image->resize(200, 200);
if ($image->save()) {
    echo 'success';
} 


1.4k
edited Jul '14

I tried it with PNG, the code above is just an example from the phalcon website. The resize with PNG does works but instead of keeping the transparency the background becomes black. Is there a solution in phalcon?



2.8k
edited Oct '16

I have the same problem with transparency in png images. Issue appears while using GD adapter only. Imagick become a solution for me.

I'm having the same problem when resizing a transparent png the background turns black and not transparent.