Jump to content

PNG PHP: Black to transparent??

- - - - -

  • Please log in to reply
1 reply to this topic

#1
bbqroast

bbqroast

    Codecall Addict

  • Members
  • PipPipPipPipPipPipPip
  • 554 posts
  • Location:/etc/passwd
In my image I have some black I wish to make transparent (as I then merge the image onto another), I guess this is 'alpha keying or 'chroma keying'?

So yeah, is there like a imagepngtransparent() function that accepts a image and a color (or just uses black) and then makes all of that color on the image transparent??
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
  • Location:Vancouver, Eh! Cleverness: 200
Assuming you wish for all the colour to be transparent, you would be looking for the imagecolortransparent function:

int imagecolortransparent ( resource $image [, int $color ] )
Resource:
PHP: imagecolortransparent - Manual
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users