Results 1 to 8 of 8

Thread: The mistery of the tga files

  1. #1
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default The mistery of the tga files

    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
    , but not for the recruitment information pannel .

    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 .

    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:

    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?
    Last edited by Monkwarrior; 11-22-2005 at 13:14.

  2. #2

    Default Re: The mistery of the tga files

    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!
    Careless Orc Costs Lives!

  3. #3
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: The mistery of the tga files

    Quote Originally Posted by Bwian
    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:
    Code:
    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


    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.

  4. #4

    Default Re: The mistery of the tga files

    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!
    Careless Orc Costs Lives!

  5. #5
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: The mistery of the tga files

    Quote Originally Posted by Bwian
    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:
    Code:
    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!!!

  6. #6

    Default Re: The mistery of the tga files

    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
    Careless Orc Costs Lives!

  7. #7
    CeltiberoRamiroI Member Monkwarrior's Avatar
    Join Date
    Apr 2004
    Location
    Salduie/Caesaraugusta/ Sarakusta/Saragossa
    Posts
    828

    Default Re: The mistery of the tga files

    Well, finally I think I understand what happened.
    This is what is seen when the wrong files are opened with Photoshop CS.


    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.

  8. #8

    Default Re: The mistery of the tga files

    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
    LT_1956 Creator of SPQR: Total War


    SPQR:TW Mod forums

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO