Grey border around img when on black background.
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Grey border around img when on black background.
Anyone else have the issue that whenever you draw a .png on a black background, you get a unwanted grey outline to your picture. Is there some kind of blend setting or AA setting that you can turn of in order to fix this?
Re: Grey border around img when on black background.
Try putting a black layer underneath your picture in the editor and see if it works.
Re: Grey border around img when on black background.
No issues there, just tried it. :Sraidho36 wrote:Try putting a black layer underneath your picture in the editor and see if it works.
I get this issue with pictures from Gimp and PS. But only ingame.
Re: Grey border around img when on black background.
What exactly the artifact looks like? A halo surrounding the silhouette or thin gray rectangle surrounding the sprite? Be more specific about this please.
Re: Grey border around img when on black background.
I had the same issue. The problem is that the transparent background is technically white. What you need is, like raidho said, a black and transparent background.
In inkscape it is possible to set the background to black-transparent. Don't know how to do it in gimp. You can try (for an experiment) to add a background in black, that is almost transparent (transparent sometimes gets removed completely): Set the alpha value to the smallest value larger than zero. That worked for me.
In inkscape it is possible to set the background to black-transparent. Don't know how to do it in gimp. You can try (for an experiment) to add a background in black, that is almost transparent (transparent sometimes gets removed completely): Set the alpha value to the smallest value larger than zero. That worked for me.
Check out my blog on gamedev
Re: Grey border around img when on black background.
In GIMP, there's an option to keep transparent pixels' colors. Dunno for PS.
- Jasoco
- Inner party member
- Posts: 3725
- Joined: Mon Jun 22, 2009 9:35 am
- Location: Pennsylvania, USA
- Contact:
Re: Grey border around img when on black background.
Also make sure to draw your image at floored coordinates by using math.floor on its X and Y. See if that helps.
-
- Party member
- Posts: 712
- Joined: Fri Jun 22, 2012 4:54 pm
- Contact:
Re: Grey border around img when on black background.
As micha mentioned, in inkscape you can simply use the image preferences to set the background transparency to (0,0,0,0) (instead of (255,255,255,0)
Solution in Gimp (for .png images):
Solution in Gimp (for .png images):
- Open file
- Select color picker tool
- Confirm with color-picker that transparency is (255,255,255,0) (Hold shift while clicking to bring up Color Picker Information Window)
- Make a new layer
- Fill new layer with black and move it to the very bottom
- With the layer selected, go to "Colors"->"Color to Alpha", choose black and confirm
- Merge the two layers ("Layer"->"Merge Down")
- Confirm with color-picker-tool that background color is now (0,0,0,0)
- Victory dance
trAInsported - Write AI to control your trains
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Bandana (Dev blog) - Platformer featuring an awesome little ninja by Micha and me
GridCars - Our jam entry for LD31
Germanunkol.de
Re: Grey border around img when on black background.
Thanks a lot! It worked like a charm.Germanunkol wrote:As micha mentioned, in inkscape you can simply use the image preferences to set the background transparency to (0,0,0,0) (instead of (255,255,255,0)
Solution in Gimp (for .png images):
- Open file
- Select color picker tool
- Confirm with color-picker that transparency is (255,255,255,0) (Hold shift while clicking to bring up Color Picker Information Window)
- Make a new layer
- Fill new layer with black and move it to the very bottom
- With the layer selected, go to "Colors"->"Color to Alpha", choose black and confirm
- Merge the two layers ("Layer"->"Merge Down")
- Confirm with color-picker-tool that background color is now (0,0,0,0)
- Victory dance
Who is online
Users browsing this forum: No registered users and 38 guests