Page 1 of 1

[won't change] Artifacts with filtering + transparent PNGs

Posted: Thu Jan 12, 2006 22:14
by Nash
Load this into the TX_ namespace as raw data, then use it on a transparent 3-d floor.

If filtering is turned on, you will see white lines that make up the 64x64 grid for Doom flats at the edges of the blood.

Posted: Thu Jan 12, 2006 22:51
by Graf Zahl
The stray white lines come from the way texture filtering works. For the filter the transparent pixels still have the color they have originally. Inside the graphic I can recolor the borders of tranaparency to the neighboring pixels but at the edges it is not that easy. Just make sure that the blood does not touch the outer edges and the effect will go away. Considering the calculation overhead required to fix this I'd say it isn't worth it.

One piece of advice: Don't use a color that stands out that much for transparency. Something less intrusive is always advisable because otherwise you may run into the same problem across the entire picture in lower mipmap levels.

Posted: Fri Jan 13, 2006 0:19
by Nash
So I have two ways to get rid of the artifact:

A) The actual graphic must not touch the edges.

B) If they absolutely have to touch the edges (tiling textures for example), I'll just have to use a transparency colour that doesn't stand out.

Got it. Thanks.

Posted: Fri Jan 13, 2006 12:01
by Nash
Sorry to bump this. I have a question. How do I set the transparent colour in Photoshop? Do you know? It is always white for me. :/

Posted: Fri Jan 13, 2006 12:14
by Graf Zahl
Photoshop is pretty bad when it comes to trivial issues like this. I normally use XNView to set the transparent color but that only works well for paletted pictures. Otherwise I use Image Alchemy but that's a command line tool.

Posted: Fri Jan 13, 2006 22:13
by BetaSword
With me, all I do is use the eraser tool, making anything I want transparent have that checkerboard background, and then when I select indexed color, I check the box that says "transparency", or whatever. Seems to work fine.

Posted: Sat Jan 14, 2006 4:29
by Nash
Beta - I know how to do transparent PNGs with Photoshop, but I don't know how to set the actual transparency colour.

using your technique, I wasn't able to choose a transparency colour...

Posted: Sat Jan 14, 2006 12:37
by Enjay
If it helps, in "Paint Shop Pro" when you save a PNG, click the options button and pick "Run Optimizer". That allows you to pick which colour will be used to mark transparent areas.