• Advertisement
Sign in to follow this  

Drawing an image to the game so that it has no white space

This topic is 2350 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

I have an image that I want to draw in my game that has some white space. How would I edit this image so that when I draw the image on the screen I won't end up with a white box embedded with the entity and just have the outlines of the entity drawn on the screen.

An example is attached.

Share this post


Link to post
Share on other sites
Advertisement

I have an image that I want to draw in my game that has some white space. How would I edit this image so that when I draw the image on the screen I won't end up with a white box embedded with the entity and just have the outlines of the entity drawn on the screen.

An example is attached.



You could use GIMP and set the white to be 100% transparent. Or you could use a color keying system where you consider a certain color to be "see-through". It depends on how you render graphics.

Share this post


Link to post
Share on other sites
You want to add an alpha channel to your image. This will effectively replace all the white pixels in your image with transparent pixels so you won't see them. You can then save your image as a PNG or other "alpha-friendly" image format and you should be good to go.

Share this post


Link to post
Share on other sites
Try to use .png, .gif or other format which supports alpha and set the alpha of the background of your image to 100%.

Share this post


Link to post
Share on other sites
Which API or game engine are you using?
You could also use a color key when loading your image or texture to do the same thing as an alpha channel.

Share this post


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

  • Advertisement