Results 1 to 20 of 20

Thread: Can someone help me with this TGA file?

  1. #1

    Default Can someone help me with this TGA file?

    Despite my best efforts to learn whatever tricks other modders use to get around this, GIMP usage and transparency in TGA files continue to be a thorn on my side. Only in very specific occasions I manage to add transparency to a file without destroying the image it contains.

    In my current mod, I have changed the attribute Authority for Prestige and the attribute Piety for Management, so I need this to be reflected in the UI images that represent Authority and Piety in the stratmap interface. I want to change the fist and the ring UI for a crown and a feather. However, the TGA file that contains them also contains several other things that unfortunately get messed up when I try to add transparency to the file. This is so because there is a lot of black and white colours in the images, and GIMP removes those colours from the images when removing the file background.

    I would appreciate if someone could teach me how to remove backgrounds without removing black and white images along the way.

  2. #2
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    8,487

    Default Re: Can someone help me with this TGA file?

    I've never managed to do it. I just could overpaint some parts of those icons, like in the building for health (with a cross inside).


  3. #3

    Default Re: Can someone help me with this TGA file?

    To use the full square image works for some purposes, but unfortunately not for this one. The icons can't all be squares.

  4. #4
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Can someone help me with this TGA file?

    Other then in portraits**, building and unit cards full transparency will always result in a black area, eg pips and ancillary pics. The only way to counter that is to create a layer with the background the pic\icon will be placed on and then paste the pic\icon onto it.
    That should not provide a challenge as all you have to do is take a screenshot of that area (suggest to save already in TGA format) and then 'copy\paste new image' that area to get a template layer.

    ** see my tutorial










  5. #5

    Default Re: Can someone help me with this TGA file?

    Quote Originally Posted by Gigantus View Post
    Other then in portraits**, building and unit cards full transparency will always result in a black area, eg pips and ancillary pics. The only way to counter that is to create a layer with the background the pic\icon will be placed on and then paste the pic\icon onto it.
    That should not provide a challenge as all you have to do is take a screenshot of that area (suggest to save already in TGA format) and then 'copy\paste new image' that area to get a template layer.

    ** see my tutorial
    Damn. This area of modding is definitely not my forte. I don't think I understand exactly what you mean or how to add a layer.

  6. #6
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Can someone help me with this TGA file?

    In graphic editors you can work on different 'layers' which are basically pictures that are stacked on top of each other. In the end it works as if you you copied a symbol on a surface that you first have worked on - only that you can keep the elements separate to use them later again.

    For you it will suffice to take a screenshot of the UI that contains your element and then cut out an empty section where you find that element (pip, ancilalry pic) on. Trim it to the size of the pip\ancillary pic and then place the pip\ancillary pic on it, save it - end of story. And if you keep a copy of the back drop then you can repeat the same procedure without much of an issue.










  7. #7

    Default Re: Can someone help me with this TGA file?

    I'll see if I manage to do this. The biggest concern is that most methods of cutting, pasting, saving, or doing anything at all to an image results in losing the transparency, and GIMP is overcomplicated.

    I'll give it a try anyway. Thanks.

  8. #8
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Can someone help me with this TGA file?

    GIMP is utterly simple in comparison to Photoshop.

    Simple steps to copy only the actual graphic and thereby maintaining transparency (GIMP procedure):

    1. open symbol's graphic
    2. activate select tool: Shift+O
    3. set threshold to zero
    4. select an area of transparency in your symbol graphic
    5. invert selection: Ctlr+I
    6. Copy: Ctlr+C
    7. paste onto your background graphic which needs to be open: Ctlr+V
    8. 'export as': name of final graphic in TGA format










  9. #9

    Default Re: Can someone help me with this TGA file?

    Quote Originally Posted by Gigantus View Post
    GIMP is utterly simple in comparison to Photoshop.

    Simple steps to copy only the actual graphic and thereby maintaining transparency (GIMP procedure):

    1. open symbol's graphic
    2. activate select tool: Shift+O
    3. set threshold to zero
    4. select an area of transparency in your symbol graphic
    5. invert selection: Ctlr+I
    6. Copy: Ctlr+C
    7. paste onto your background graphic which needs to be open: Ctlr+V
    8. 'export as': name of final graphic in TGA format
    Thanks for this. I'll be busy for the next three or four days, but I'll try this out as soon as I can.

  10. #10
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Can someone help me with this TGA file?

    Let me know if you run into issues










  11. #11
    Jurand of Cracow's Avatar History and gameplay!
    Join Date
    Oct 2012
    Location
    Cracovia
    Posts
    8,487

    Default Re: Can someone help me with this TGA file?

    Quote Originally Posted by Gigantus View Post
    Other then in portraits**, building and unit cards full transparency will always result in a black area, eg pips and ancillary pics. The only way to counter that is to create a layer with the background the pic\icon will be placed on and then paste the pic\icon onto it.
    So this means that all the icons in the Med2 city panel (like mine in that second post in this thread) actually have a beige background (not a transparent one) that looks if they're transparent, right?

  12. #12
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Can someone help me with this TGA file?

    That's how I would have done it. I honestly have no idea how CA managed to have transparency for their pips (all default pips have alpha channel), that's why I use the method I described.










  13. #13

    Default Re: Can someone help me with this TGA file?

    Quote Originally Posted by Gigantus View Post
    GIMP is utterly simple in comparison to Photoshop.

    Simple steps to copy only the actual graphic and thereby maintaining transparency (GIMP procedure):

    1. open symbol's graphic
    2. activate select tool: Shift+O
    3. set threshold to zero
    4. select an area of transparency in your symbol graphic
    5. invert selection: Ctlr+I
    6. Copy: Ctlr+C
    7. paste onto your background graphic which needs to be open: Ctlr+V
    8. 'export as': name of final graphic in TGA format
    Well, I think I got lost around step number 3, but possibly even before that

  14. #14
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Can someone help me with this TGA file?

    I have listed the keyboard shortcuts for the various steps, simply press those combinations at the point I am posting them. Threshold: in the tool window there is a section below that let's you set particulars of the tool you selected, check for the slider and set it to zero.










  15. #15

    Default Re: Can someone help me with this TGA file?

    Quote Originally Posted by Gigantus View Post
    I have listed the keyboard shortcuts for the various steps, simply press those combinations at the point I am posting them. Threshold: in the tool window there is a section below that let's you set particulars of the tool you selected, check for the slider and set it to zero.
    I mean, the terms you use are not all clear to me.

    By "open the symbol's graphic" you mean open the TGA file that contains the symbol together with all the other stuff?

    How do I select an area of transparency? Once I activate the selection tool, clicking anywhere in the image doesn't seem to produce any effect. All that seems to happen is that GIMP captures the colour shade I clicked on. But what do I do with this colour? As I said, selecting the black background probably doesn't help because there are some images that contain black parts too.

  16. #16
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Can someone help me with this TGA file?

    By "open the symbol's graphic" you mean open the TGA file that contains the symbol together with all the other stuff?
    Correct
    How do I select an area of transparency?
    You click on a transparent area of the graphic after activating the tool. I understood that you have transparency in your original graphic, hence that approach.

    Note: Shift+O will select ALL areas of the selected color. Using U instead will only select a contiguous area that contains that color, eg the outline instead of bits and pieces as well.

    Maybe upload that graphic so I can have a look at it and give some 'hands on' advice?










  17. #17

    Default Re: Can someone help me with this TGA file?

    Oh, I think I understand (or not, we shall see).

    But problem is, after I change the symbol, the transparency of the original file disappears and becomes solid black. I intended to use GIMP to restore it, but your approach pre-assumes that the transparency is still there. Unless I misunderstood.

    Here is the image after I converted it to JPG:


    .
    It has no transparency.
    Last edited by es157; October 14, 2021 at 06:41 AM.

  18. #18
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Can someone help me with this TGA file?

    That's stratpage_04. Simply turn black into alpha:

    1. open your graphics
    2. activate selection tool with U
    3. select a black area
    4. go to 'colors\color to alpha
    5. to the right of the 'color' strip in the small window is 'picker' symbol - click it and select a sport inside your black area and then click 'ok'
    6. all the black, slected area should be transparent now










  19. #19

    Default Re: Can someone help me with this TGA file?

    Thanks! It worked nicely.

    You're the best.

  20. #20
    Gigantus's Avatar I am not special - I am a limited edition.
    Patrician took an arrow to the knee spy of the council

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    53,125
    Blog Entries
    35

    Default Re: Can someone help me with this TGA file?











Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •