Home Technical Talk

PNG or TGA ? I dont get it

interpolator
Offline / Send Message
Shrike interpolator
Hello guys


I dont really understand which format to choose for transparent
textures. (Or textures at all)

I always used .pngs because they seemed to work fine and .tga sometimes had
strange (Way too large) kb sizes I didnt understand.

As far as I read does tga save processing power when you have black spaces or something like that ? And I read that TGA is a outdated format beeing created by IdTech which is using something better and new now ?

.tiff is lossless and can save layers, I get that.

Are there any other better formats ?



Please enlighten me

Replies

  • monster
    Offline / Send Message
    monster polycounter
    What game engine/renderer are you using?

    Either one should be fine really.
  • m4dcow
    Offline / Send Message
    m4dcow interpolator
    Like Monster said either should be okay. I stick to TGAs because of habit, and I know photoshop had issues with how it saved PNGs at one point, specifically those with alpha channels.
  • Ace-Angel
    Offline / Send Message
    Ace-Angel polycounter lvl 12
    TGA's, because most engines will process them much better (especially for mipmaps) and most image editing softwares cannot process/read 32bit PNG's for Alpha if you should require such a thing.
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    the main problem with png is that in photoshop it doesn't have a separate alpha channel so you can't explicitly set the colour value of semi-transparent pixels
  • ZacD
    Offline / Send Message
    ZacD ngon master
    Png's are awesome for posting things online and when working in RGB, they suck for anything with alpha, but the are nice because they are pretty small space wise.
  • Justin Meisse
    Offline / Send Message
    Justin Meisse polycounter lvl 19
    my process for dealing with PNGs - I put all my layers inside a folder and put a layer mask on the folder itself
  • kio
    Offline / Send Message
    kio polycounter lvl 16
    i believe this comes partly from the crappy png support of photoshop.

    as it makes no sense why png's have only applied alpha channel and most other formats dont. or the other way around, why only png have an applied alpha and not an explicit channel.

    anyways i guess most people just went along and work with it anyways ( me too )

    there is this little plugin http://www.fnordware.com/superpng/ which allows for explicit alpha in png - just good to know
  • Farfarer
    Yeah, SuperPNG is awesome.

    Issue with pngs for textures is that PNG compression will optimise the transparent parts of your image down to block colours (but not on images with an alpha channel rather than transparency - which Photoshop doesn't natively support). Which, if you'll definitely be using it for transparency, isn't an issue, but is for other stuff you want full RGBA info intact.
  • Shrike
    Offline / Send Message
    Shrike interpolator
    I use cinema4D for non realtime renderings, UDK and unity for assets, mainly UDK


    So PNGs are smaller but the format compresses the image worse ?
    TGA handles mipmapping better so pixels dont get disorted as much when
    scaled I read out ?

    I dont quite get the transparency >< alpha thing

    Could you explain it a bit more visual please ?

    You can not set the colour value of semi-transparent pixels ?
    This results in what exactly ?
  • Farfarer
    PNGs and TGAs are lossless - there are no compression artefacts from either format.

    TGA is uncompressed (larger files), where PNG is compressed (smaller files).

    Neither format has mip maps.

    TGA has RGBA channels. PNG has RGBA but the alpha channel is either stored as a separate channel (like TGA) or as a transparency amount.

    Some PNG compressions try to lower the file size by filling areas which are black in the alpha channel with block colour. So if this method is used, the colour data in the RGB channels is lost.

    More reading here;
    http://www.smashingmagazine.com/2009/07/15/clever-png-optimization-techniques/
  • McGreed
    Offline / Send Message
    McGreed polycounter lvl 15
    There was a thread once, I can't remember if it was here or on UDK, which also talked about those and mainly about image formats with and without compression. The issue was that if you have an engine of some kind, for compressed image formats, it not only had to read the image, but had to decompress it to use in the engine, while formats such as TGA it only had to read it. So using uncompressed formats would skip a step and use less computer resources or something when working with an engine (or was it just shaders in general? cant remember)
    Please correct me if I'm wrong, or if someone else remembers this.
  • gHys
    Offline / Send Message
    gHys polycounter lvl 5
    png it's realy good for space but it takes a hell of a lot time to load in pretty much all engine and compositing software as i know, maybe on render don't make any difference but don't know.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 12
    gHys wrote: »
    png it's realy good for space but it takes a hell of a lot time to load in pretty much all engine and compositing software as i know, maybe on render don't make any difference but don't know.

    almost all game engines olny use png or tga, for getting content into the game engine, once it is there it is usually converted to dds, and gets mipmaps generated for it.
  • joebount
    Offline / Send Message
    joebount polycounter lvl 13
    And what about simply using DDS, uh ?
Sign In or Register to comment.