| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|problems with GD image transparency|
imagecolorallocatealpha wont change all white pixels to alpha
| 11:58 am on Jun 11, 2008 (gmt 0)|
Basically what I want to do is change all the white pixels in a png image to transparent. Found this code somewhere, which seems to make most of the white pixels transparent, but not all.
$png = imagecreatefrompng("top.png");
$trans_colour = imagecolorallocatealpha($png, 255, 255, 255, 127);
imagefill($png, 0, 0, $trans_colour);
How do I do this?
| 12:05 pm on Jun 11, 2008 (gmt 0)|
$im = imagecreatefrompng("top.png");
$bg_color = imagecolorat($im,1,40);
Worked fine. Thanks
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved