Black outline in Sprites using transparent PNGs as Textures
See original GitHub issueWhen using a transparent PNG as a Texture of a Sprite, when the Sprite scales in size it seems to appear a weird black outline like the above:
(See the black pixels around the triangle)
Any clue on how to avoid this?
I obviously could use very big PNGs, but that’s not an option as I am using lots of them and the loading time wouldn’t be acceptable.
So any recommendation will be very appreciated! 😃
Thanks in advance.
Issue Analytics
- State:
- Created 11 years ago
- Comments:14 (9 by maintainers)
Top Results From Across the Web
Black boarder on transparent sprites
Hi guys,. I just created a new project and added my sprite, why am I getting these black boarders, I tried to change...
Read more >Why do my sprites have a dark shadow/line/frame ...
The Problem is that they all are surrounded with thin dark lines. The screen shot below shows two rectangles with a png image...
Read more >a transparent background and bring it into Blender [2.82]
In this quick tip tutorial, we will be learning how to prepare an image with transparency in GIMP and then import an image...
Read more >three.js transparent png texture strange border webgl
The pngs get strange borders at the area between visible and transparent. I allready tried to play around with alphatest value but then...
Read more >Photoshop Tip: Get rid of ghost outlines around sprites
The color of any onscreen pixel is actually a blend of neighboring pixels on a texture. The issue arises with opaque pixels that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Indeed!
I see. Well, I’m of course missing context on what you’re actually doing, but you can try this:
For every image you draw the shapes a bit bigger. And then you draw the shapes again in the normal size in a temporal canvas. Then you do this:
That way you’ll be adding extra color padding to your color channels while the alpha channel will have the size you need.
I’m not sure it works for what you’re trying to do, but it’s a technique that can be pretty handy when used well 😃
I don’t think it’s that. The image seems fine:
http://twitpic.com/95amq5/full
I have the feeling it has something to do with premultiplication. Or maybe the blend operation…