how to make trasparent the background of an Image

GD and GD2 are useful libraries for creating graphics on-the-fly. Discuss your PHP GD and GD2 scripts here.

Moderators: onion2k, General Moderators

Post Reply
dtrejogo
Forum Newbie
Posts: 1
Joined: Wed May 20, 2009 10:59 am

how to make trasparent the background of an Image

Post by dtrejogo »

Hi everybody.

How can I add transparent background to any Image.. for example I have a JPEG image with white background color, and I want to change this background color to transparent (.png). I think that this can be done with the GD Library of php but I have tried with functions like ImageCreateTrueColor, ImageColorAllocate, ImageColorTransparent... but I have not been successful..

thanks .. !
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Re: how to make trasparent the background of an Image

Post by Benjamin »

:arrow: Moved to PHPGD.com. Onion2k would know :)
Post Reply