| Welcome to WebmasterWorld Guest from 220.127.116.11 |
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
|Subscribe and Support WebmasterWorld|
|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.
© Webmaster World 1996-2013 all rights reserved