TIP: How to make transparent TGA files (to use with Yafray)

This is a bottle with a glass material, and a PNG texture for the label (I know now that PNGs don’t work with Yafray, but this is how I started the whole thing):


Then I learned that TGA files could store transparency, but only if they were saved with a 32 bit depth, so I took the original PNG and saved it again in photoshop. This was the result:


You can see the label now but the bottle isn’t transparent. So I discarded the Photoshop option, searched through google and found this little program called “Image Converter Plus” which turned my PNG into a fully transparent TGA:


Here’s the url if you want to try it:

I have used TGA in PaintShop Pro 7.0 and had great success with the Alpha Channel too, when applying a lable to a glass bottle.

YafRay image…

That looks great.

How did you manage to get a transparent TGA with PSP? I always get a white background with no alpha.

That looks great.

How did you manage to get a transparent TGA with PSP? I always get a white background with no alpha.[/quote]

Load the alpha image into the project, as normal for alpha images. Don’t forget to select that UseAlpha button.

Now, you need to load another NEW image into the project. This just happens to be the same exact alpha image as the first. But here’s what you need to do it…
…in the materials setcion, use the Alpha button instead of the COL button.

That’s all! Render it and see what happens.


Please Can somebody attach sample of .blend file with a scene containing object with transparent.tga picture which will create real shadow (exluding transparent part … of course!) and rendered with yafray?


Why can’t you use both alpha and col buttons in the same texture?

I’ve managed to make transparent TGA files with Photoshop.

  • Create the image in Photoshop. It will make your life easier if the image is square (i.e., width and height are the same).

  • In the layer display, if there is a padlock symbol on the base layer, duplicate the layer.


  • In layer display, on top layer, click layer mask

  • Make sections of image that are to be transparent into black. Use magic wand selector, shift click until all transparent areas are selected, then fill with black.


  • Delete backgroud layer if you had to duplicate layer

  • Save as a TARGA file, must be 32 bits per pizel.

Duhast, is this what you did? I’m puzzled why my TGAs were transparent but yours were not.

No, I tried other settings and that’s why I couldn’t make the transparency work.

I tried to use photoshop because PSP (the one I always use) doesn’t save TGAs with 32 bits (only 24) and I thought that was the only way to make transparent TGAs, but now I know how to make them with PSP and here it is how to do it:


It’s really simple.

Why can’t you use both alpha and col buttons in the same texture?[/quote]

I don’t know. Maybe you could.

just noticed this thread… sometimes the easiest solution is the one that is completely overlooked…

load 32 bit png into the seq editor
select targa as output file format (rgba of course)
“render” it (f12)
save it (f3)

the seq editor is a great image converter… avi codec converter too