Alpha colour outline around graphics

Started by
6 comments, last by XXChester 12 years, 11 months ago
Hello all, I am still fairly knew to game programming and in my latest demo I decided to no longer use a solid back ground, so now I am running into a problem where the graphic has a white(Or whatever my alpha colour is) outlining around it. I am wondering is there a way to fix this programmatically or is it strictly (or more importantly easier) to correct it in the graphics editing software such as GIMP or Photoshop?


Thank you.

Remember to mark someones post as helpful if you found it so.

Journal:

http://www.gamedev.net/blog/908-xxchesters-blog/

Portfolio:

http://www.BrandonMcCulligh.ca

Company:

www.gwnp.ca

Advertisement

Hello all, I am still fairly knew to game programming and in my latest demo I decided to no longer use a solid back ground, so now I am running into a problem where the graphic has a white(Or whatever my alpha colour is) outlining around it. I am wondering is there a way to fix this programmatically or is it strictly (or more importantly easier) to correct it in the graphics editing software such as GIMP or Photoshop?


Thank you.


Which Graphics library / Engine are you using?

In directx you can set a colorkey to be a transparent color when loading a texture such as:
D3DCOLOR colorkey = 0xFFFF00FF;
Use pre-multiplied alpha!

http://blogs.msdn.com/b/shawnhar/archive/2009/11/06/premultiplied-alpha.aspx
Sorry forgot to mention that, I am using XNA 4.0. I know the reason I get the outlining is because the colour is actually a light grey between the white background and image, because of Anti aliasing in the graphics program. I set the colour key to 255,255,255,255 and it gets rid of the back ground correctly it is just the out line that I cannot seem to fix. Like I said it makes sense why it doesn't work because it isn't actually white but I am wondering is there a way to apply a second colour mask or is it up to the artist to make sure the images are not AA'd?

Thanks.

Remember to mark someones post as helpful if you found it so.

Journal:

http://www.gamedev.net/blog/908-xxchesters-blog/

Portfolio:

http://www.BrandonMcCulligh.ca

Company:

www.gwnp.ca

http://blogs.msdn.com/b/shawnhar/archive/2010/04/08/premultiplied-alpha-in-xna-game-studio-4-0.aspx
Thanks Daaark I will try these out tonight when I get home.

Remember to mark someones post as helpful if you found it so.

Journal:

http://www.gamedev.net/blog/908-xxchesters-blog/

Portfolio:

http://www.BrandonMcCulligh.ca

Company:

www.gwnp.ca

I don't think he is talking about alpha blending. I think he took a non-RGBA image and made everything white alpha 0 to add an alpha channel, then it left all the gray from the anti-aliased image edges. Depending on the software your artist used, he should have a non-AAed version of the art that you can add the alpha channel to.

I think it is this problem.
Figured out how to do it via the art. I was already doing the premultiplied alpha stuff. I found an easy way to do it in GIMP...just make my whole first layer transparent and than duplicate and draw from there.

Thanks,

Remember to mark someones post as helpful if you found it so.

Journal:

http://www.gamedev.net/blog/908-xxchesters-blog/

Portfolio:

http://www.BrandonMcCulligh.ca

Company:

www.gwnp.ca

This topic is closed to new replies.

Advertisement