sprite transparency

Posted By: juszczec

sprite transparency - 03/11/07 17:02

Hi folks

I've made a sprite of a cactus. Its a jpg converted to a pcx. The entire picture is rectangular with dimensions 250x700 pixels.

The cactus itself does not take up the entire 250x750 rectangle. I want the sky to be visible behind it.

Is there a way, using GIMP, to make selected areas of pcx transparent so my backrgound will be visible? Can I do this in WED?

Mark
Posted By: Robotronic

Re: sprite transparency - 03/12/07 12:31

Hello!

Iīm not familiar with Gimp, however some general advice:

For partly visible images you need the alpha channel and a 32 bit format, that supports the alpha channel. You canīt store alpha channel in .pcx files. So you should use 32 bit Targa (.tga) files instead (.dds files also work, but letīs keep it siomple for the moment). Gimp certainly supports .tga.

The other thing: I would recommend you, to use always textures with a size, that is a power of two, for example 256 * 256, 512 * 512, 1024 * 1024 ...

The creation of the alpha channel usually is simple: In Paintshop i woul simply select the cactus and then go to the selection menue and choose "store selection in alpha channel. The alpha channel has to be white, where you want to see the cactus and black, where you want the image to be transparent.

In WED you can simply load the image as a sprite. The sky will be visible, where the alpha channel is black.
© 2023 lite-C Forums