Log in

View Full Version : The mistery of the tga files



Monkwarrior
11-22-2005, 13:07
This message is a call for help from the experts in formats of graphic files.
I reported some time ago my problems with info_pics for units. I made them with Adobe Photoshop 7.0 by the simplest method:
- From a screenshot I deleted the excess of picture, leaving a transparent background. This image, of the correct size, was saved as 32 bits tga.
The result was OK for the information pannel https://img399.imageshack.us/img399/5629/infoluso12iz.th.jpg (https://img399.imageshack.us/my.php?image=infoluso12iz.jpg)
, but not for the recruitment information pannel https://img399.imageshack.us/img399/3592/infoluso26kf.th.jpg (https://img399.imageshack.us/my.php?image=infoluso26kf.jpg).

After this report of my problem, Uranos (thanks my friend) helped me saying that the solution would be to put a background, identical to that used in the information pannel.
He did with a light brown background, but including an alpha channel to make it transparent.
I was surprised with I opened his modified pic, as it was identical to mine in my photoshop version. But it worked differently in the game.

Now it was the same in info pannel (the background was considered transparent), but not in recruitment information pannel https://img293.imageshack.us/img293/5646/infouranos13zy.th.jpg (https://img293.imageshack.us/my.php?image=infouranos13zy.jpg).

I'm trying to find any other method to do info_pics, but in the process I've found this.
When I save the differents tga files as dds, this is the result: https://img512.imageshack.us/img512/3357/misteriostga7sh.th.jpg (https://img512.imageshack.us/my.php?image=misteriostga7sh.jpg)

In the middle, there is my original file, and the same problem in-game can be seen here. It seems then that the game transforms the original tga in some dds format, unable to handle transparent backgrounds.
On the left, there is the Uranos modified file. The same image than that observed in the game is generated. Now, even if photoshop shows a transparent background, the dds file shows the light brown color.

Finally on the right, my attempt to include the new UI background to my pic. I include a new background layer and the alpha channel. I merged both layers and did the white silhouette in the alpha channel.
However, when I saved as 32 bits tga, the alpha channel disappears, the background is still visible, but now the dds generated is correct.

I must still test this new file in-game.
In any case I wonder why my tga files are larger (132 kb) than those in the original game (around 90 kB).

Any explanation for this behaviour?

Bwian
11-22-2005, 19:07
Put simply .... Alpha Channels.

When you removed the background of the image, leaving it transparent in Photoshop, you have NOT actually made it transparent as far as teh game is concerned.

You need to add an extra channel... the Alpha Channel, to make things transparent in the game.

The alpha channel is a black and white 'layer' that is saved along with your graphic. Where the alpha layer is white, you will see you texture. Where it's black, the texture will show up as completely transparent. Shades of grey give you effects in between

In the 'channels' box, just add a new one ( this should automatically be an alpha channel) along with the R,G,B ones. Select your 'blank' area on the RGB picture, go to alpha, and make that ALL black. Invert the selection, and make that all white.

Save it as tga, and make SURE you do NOT exclude the alpha channel data on saving.

Your unit card should now look fine!

Monkwarrior
11-22-2005, 19:32
Save it as tga, and make SURE you do NOT exclude the alpha channel data on saving.

I think I've found the problem.
From PS 7.0 Help:

Note: As long as you save a file in a format supporting the image's color mode, the color channels are preserved. Alpha channels are preserved only when you save a file in Adobe Photoshop, PDF, PICT, Pixar, TIFF, or Raw formats. DCS 2.0 format only preserves spot channels. Saving in other formats may cause channel information to be discarded~:mecry:

I think the update 7.0.1 will solve this problem and I hope to solve it soon.
The most intriguing to me is that sometimes the transparency is admited (see my cards or the info_pics in some of the screenshots) but in other ocasions the information is messed up.

Bwian
11-23-2005, 09:43
Thats odd... when I save as .tga, I can safely preserve the alpha channel. I have Photoshop 5.5.... I don't think this is exactly the problem.

As a test.... open up a stock unit card and look at that. You will need to extract the PAK files to get at them..or if you don't want to ...drop me a PM and I will send you a stock one.

Look at that file in PSP and find the alpha channel. It will be there....and that will make sure you aer looking at the right thing. Then try saving the file as a tga. There should be some save options there when you choose to 'save a copy' ... look under the bit where you type in the name of the file when you save a copy...I think it defaults to exclude alpha...

If the file works OK...job done. If it doesn't...then you have a PSP problem!

Monkwarrior
11-23-2005, 12:06
Thats odd... when I save as .tga, I can safely preserve the alpha channel. I have Photoshop 5.5.... I don't think this is exactly the problem.

It seems that version 7.0 had a bug, because I had no option to select alpha channel when the format tga was selected in "Save as".

This is from Adobe webpage:

The Adobe® Photoshop® 7.0.1 update fixes a number of problems discovered after Photoshop 7.0 was released.

The most significant fixes in the 7.0.1 release include the following:

• Photoshop now saves alpha transparency data in Targa files in the same way it did in previous versions.


And I've remarked this problem by now!!!~:mecry:

Bwian
11-23-2005, 12:54
Eek! Thats a nasty little bug ... but at least they do have a fix for it! There are some advantages to having an out of date version then ~;)

Monkwarrior
11-23-2005, 16:38
Well, finally I think I understand what happened.
This is what is seen when the wrong files are opened with Photoshop CS.

https://img481.imageshack.us/img481/2277/misterios30li.th.jpg (https://img481.imageshack.us/my.php?image=misterios30li.jpg)
The alpha channel is there, but in the saving process, the Photoshop 7.0 messed up the channels in the visible part. However, the program opened alpha channel as part of the visible one and all the psicodelic surroundings were hidden.
At least the problem is found and in way to solution.
Thanks.~;)

lt1956
11-25-2005, 11:25
No I had the same problem. I think its a Glitch in the game that Messages dont have transparency. It only happens in the messages, this happened to me in SPQR.

I dont think its a software issue at all but a game bug. If you notice all of CAs cards are Cream background that Matches Perfectly message backgrounds.

I think this is normal and was only noticed when making cards using 3Dmax. I fixed it by making all the cards like yours to have the same background as the others.

Hope this helps.

Lt