Jump to content
  • Advertisement
Sign in to follow this  
Juliean

Texture: Removing black with a colorkey

This topic is 2606 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi,

I know that I can use colorkeys to remove the background color of images when using e.g. D3DXLoadTextureFromFileEx(). However, this isn't working for black (D3DCOLOR_XRGB(0, 0, 0)). Is there any way to remove black from a loaded texture? If not, how can I do so in a program like Photoshop? I want to use images like this for here for lens-flaring:

cxbpfnvt.png

Any idead how to remove the black background to transparent?

Share this post


Link to post
Share on other sites
Advertisement
In photoshop, paste the image into a layer, create a mask for that layer, and then copy / paste the same image onto the mask (black is transparent in the mask layer, and white is opaque). You will almost certainly have to fiddle with the mask to make the image as similar as possible to the original (stick another layer filled with black under the masked layer to compare).

Share this post


Link to post
Share on other sites
For lens flare, don't you want additive blend anyway? In which case the alpha is irrelevant (Colour + (0, 0, 0) == Colour)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!