imageColorAllocateAlpha() for GIFs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

imageColorAllocateAlpha() for GIFs

Post by Ollie Saunders »

It seems that imageColorAllocateAlpha() functions as if there is no alpha at all for GIF images. Does anybody know of a workaround, how to get imageColorAllocateAlpha() to work for GIF images how it should?
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Re: imageColorAllocateAlpha() for GIFs

Post by Zoxive »

GIFs do not technically have an alpha channel, only 2 states, on or off.
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Re: imageColorAllocateAlpha() for GIFs

Post by Ollie Saunders »

This I understand. In this instance I don't actually want to leave any semi-transparent pixels I just want to fill with white at 50% opacity creating a washed out image which can be achieved by changing the existing colour pallette.

Hmm, it would be slow but perhaps I could iterate over each pixel.
Post Reply