Game Development Community

Pink line when using alpha channel

by Dennis De Marco · in Torque Game Builder · 06/16/2006 (6:22 pm) · 5 replies

I"m working on a tile based RPG and making some contour land around water tiles.

I created a alpha channel and cleared the sections that I want transparent in GIMP. The problem is there is a visible 'pink' cut-out line between the alpha and non alpha.

I am not much of an artist, but any tips are welcome. Tinkering around with the EUO simple tilesets.

www.demarco.com/~dennis/pink.png

Those pink lines do not show up in gimp, but only inside the editor. I tried messing with all the features of the layered blending without much luck.

#1
06/16/2006 (7:03 pm)
I removed the 'smooth' filter mode option from my tilemaps and this pink line went away.

But I really did like the smooth look. Anyone have any tips? Is this something I can edit in an editor or something I'm doing wrong with gimp? Or a feature/bug? of using smooth with alpha/transparancy?
#2
06/18/2006 (3:14 pm)
I had this problem when i had a red background. I just changed it to transparent. But I kindof have a similar problem because on my sprite strip my sprites are packed together with no spaces between them, so if i have it set on smooth some of the color from one sprite will show up on the one next to it.
#3
06/19/2006 (12:22 am)
James,

To stop colours blending into each other (an artifact of the hardware bilinear filtering on your GPU) then use the "filterpad" option that TGB provides. You can find this and much more in the comprehensive image-map doco.

Halos that surround imagery is again caused by the GPU (in bilinear mode) intepolating the texels with little/full alpha to texels with no alpha. During the interpolation, you unfortunately see the intermediary colour. There isn't anything that TGB can do about this apart from you setting the zero-alpha colour in your art or using no filtering.

Hope this helps,

- Melv.
#4
05/16/2007 (9:58 am)
Melv,

I'm pretty sure what you are describing is the current issue I'm having with TGBX. I've created another thread here pertaining to this issue. Do you have any suggestions on how to fix this?

Thanks!
-csa
#5
05/18/2007 (9:04 pm)
A good way to ensure that the transparent edges of your images bleed into the appropriate color is to use the .jpg and .alpha.jpg method of transparency, not .png transparency.

Save your image as a .jpg with a black background (or another suitable color, similar to the edges of your image) then save a greyscale .jpg file with the same name as your image, but with a .alpha.jpg extension. It's important that it is a greyscale (1 channel, not RGB 3 channels). The white parts of the .alpha.jpg image will be opaque, the black will be transparent, greys are semi-transparent.

I've found that when I package my game it ignores .alpha.jpg images, so be sure to check they are included when you build your game.