Clearance about JPG and TGA


(Justice) #1

So… TGA requires more then double the size of a JPG/JPEG. Why is TGA so overused then? Seems to me the only addition TGA offers is the use of an alpha channel (32 bits).

Is there any reason I should use TGA instead of JPG?


(Smurfer) #2

If you want transparency and or shaders to work.


(Avoc) #3

.tga compresses better than .jpg when you put it in the .pk3


(Indloon) #4

TGA is lossless format,this means colors don’t lost,while JPEG one does.
Also the quality,it is way better in TGA as I said above the reason.
TGA supports Alpha,this makes it beast!:smiley:


(Justice) #5

Well, I actually used JPGs for terrain rendering. So it seems you would only use TGAs for uninfluenced shine-through objects, doesn’t it?

And the loss of quality easily be substituted by a larger, more detailed image, since JPGs are half the size of a TGA anyway.

When weighing both quantity and quality, it seems to me that choosing for JPG (less quantity & quality) would be the better option. People do not like big downloads.


(-SSF-Sage) #6

Use TGA when you need good quality or alpha. Otherwise JPG. Same with the texture size, the more you need the bigger you go. Always the size vs quality, decide for every situation. Nothing stops you to using both.


(Krischan) #7

It is even possible to “mix” TGA and JPG, I did this for my transparent worn posters. It uses a TGA which is completely black but has an alpha channel (black=background shining through, white shows the poster). The posters itself are simple JPGs with a dark border matching the matte TGA alpha channel. The advantage is to have a lot of transparent posters with a single alpha image in small file sizes for the disadvantage of two render passes in the shader.

Description/demo is here