SDL_Image alpha support

A friend and i are developing a game, i write code, he suply graphics.
But now he’s talking about per-pixel based alpha transparency for the images
and i’d rather not implement this myself.

Is there there going to be support for that in future versions ?

And also is it worth the bother, speed wise ( is that spelled corectly ? ) ?

Thanks for a great and simple library.–
Best Regards / Venlig Hilsen
Rasmus Toftdahl Olesen
halfdan at halfdan.dyndns.org
http://halfdan.dyndns.org

A friend and i are developing a game, i write code, he suply graphics.
But now he’s talking about per-pixel based alpha transparency for the images
and i’d rather not implement this myself.

Is there there going to be support for that in future versions ?

SDL has supported it for a long time. SDL_image loads images with alpha
channel from TGA, PNG and TIFF files.

And also is it worth the bother, speed wise ( is that spelled corectly ? ) ?

If you use RLE (see SDL_SetAlpha()), you only pay the cost for translucent
pixels (those neither opaque nor completely transparent). Otherwise it’s
almost exactly the same as simple colourkeyed transparency where you have
one “transparent colour”.

“Mattias Engdeg?rd” writes:

A friend and i are developing a game, i write code, he suply graphics.
But now he’s talking about per-pixel based alpha transparency for the images
and i’d rather not implement this myself.

Is there there going to be support for that in future versions ?

SDL has supported it for a long time. SDL_image loads images with alpha
channel from TGA, PNG and TIFF files.

And also is it worth the bother, speed wise ( is that spelled corectly ? ) ?

If you use RLE (see SDL_SetAlpha()), you only pay the cost for translucent
pixels (those neither opaque nor completely transparent). Otherwise it’s
almost exactly the same as simple colourkeyed transparency where you have
one “transparent colour”.
Then it’s maybe just me who doesn’t know how to do it in the gimp, i played around with
it but it still doesn’t seem to work.
When i save the image in the gimp i use the layers dialog box to make the pixels translucent
and i save it to a file ( tried png, tga and tiff ), but when i open it again it has lost
the translucency, i tried with rle on tga, with the keep transparency checked - but still
no luck.

Can anybody shed some light on this, it would make the magic effects in the game so much
better looking.–
Best Regards / Venlig Hilsen
Rasmus Toftdahl Olesen
halfdan at halfdan.dyndns.org
http://halfdan.dyndns.org

Then it’s maybe just me who doesn’t know how to do it in the gimp, i
played around with it but it still doesn’t seem to work. When i save the
image in the gimp i use the layers dialog box to make the pixels
translucent and i save it to a file ( tried png, tga and tiff ), but when
i open it again it has lost the translucency, i tried with rle on tga,
with the keep transparency checked - but still no luck.

please post a link to sample files so I can have a look at them, preferably
one of each format

http://halfdan.dyndns.org/~halfdan/baal/
The transparent ones are the brick1_trans_x_120.* ones.–
Best Regards / Venlig Hilsen
Rasmus Toftdahl Olesen
halfdan at halfdan.dyndns.org
http://halfdan.dyndns.org

http://halfdan.dyndns.org/~halfdan/baal/
The transparent ones are the brick1_trans_x_120.* ones.

They are all three 32bpp RGB+alpha images with valid transparency,
and the showimage program (that comes with SDL_image) had no difficulty
in reading them

(In fact, the files brick1_trans_x_120.tga and brick1_x_120.tga are
identical)

“Mattias Engdeg?rd” writes:

http://halfdan.dyndns.org/~halfdan/baal/
The transparent ones are the brick1_trans_x_120.* ones.

They are all three 32bpp RGB+alpha images with valid transparency,
and the showimage program (that comes with SDL_image) had no difficulty
in reading them

(In fact, the files brick1_trans_x_120.tga and brick1_x_120.tga are
identical)
Thank you for taking time to take a look.

I guess it’s just the gimp that doesn’t show the transparency.

And silly me for not looking at the showimage code.–
Best Regards / Venlig Hilsen
Rasmus Toftdahl Olesen
halfdan at halfdan.dyndns.org
http://halfdan.dyndns.org