Quake3World.com Forums
     Level Editing & Modeling
        What's better: *.jpg or *.tga?


Post new topicReply to topic
Login | Profile | | FAQ | Search | IRC




Print view Previous topic | Next topic 
Topic Starter Topic: What's better: *.jpg or *.tga?

Grunt
Grunt
Joined: 22 Dec 2014
Posts: 58
PostPosted: 05-21-2015 11:42 PM           Profile Send private message  E-mail  Edit post Reply with quote


What's better (if there is no alpha channel): *.jpg or *.tga?

1. SIZE - I know that *.jpg size is less. But what's about multiple files zipped in *.pk3 archives?
2. QUALITY - Is there any visible difference how the game engine draws textures of *.jpg or *.tga files?
3. SPEED of reading and rendering (visualization) - What files (*.jpg or *.tga) are rendered faster?




Top
                 

Trainee
Trainee
Joined: 20 May 2015
Posts: 32
PostPosted: 05-22-2015 12:03 AM           Profile Send private message  E-mail  Edit post Reply with quote


V1979 wrote:
What's better (if there is no alpha channel): *.jpg or *.tga?

1. SIZE - I know that *.jpg size is less. But what's about multiple files zipped in *.pk3 archives?
2. QUALITY - Is there any visible difference how the game engine draws textures of *.jpg or *.tga files?
3. SPEED of reading and rendering (visualization) - What files (*.jpg or *.tga) are rendered faster?



1 + 2. Size + Quality:
use imagemagick to convert your TGA to JPG:
convert -quality 97 -filter Lanczos <input.tga> <output.jpg>

another imagemagick command to compress jpg:
mogrify -quality 97 -filter Lanczos <file.jpg>

and try to reduce the general filesize of a jpg by removing EXIF and other clutter (not an imagemagick command; see google for details):
jpegoptim --strip-all

quality setting at 97% is hardly noticable. Even if you zoom / stretch the image by factor 4 or 6 and certainly not ingame.
Always convert your tga skybox to jpg and reduce the quality a bit.

3. Speed:
I would presume the "burden" to renderer and q3-pk3 filesystem is also reduced when the filesize is reduced.

TIP:
use 7zip (zip setting ofc) to create your pk3 archive.




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44131
PostPosted: 05-22-2015 01:14 AM           Profile   Send private message  E-mail  Edit post Reply with quote


For all practical means, simply stick to JPG for non-alpha channel textures and use TGA for textures that have an alpha channel. Quake 3 is a 15 year old game, there's not much performance to be gained from choosing one format over another.




Top
                 

Commander
Commander
Joined: 10 Apr 2015
Posts: 137
PostPosted: 05-22-2015 03:23 AM           Profile Send private message  E-mail  Edit post Reply with quote


Yeah for none alpha images, stick to JPG, and for convenience, if you have Photoshop, you can save them with quality setting of 12 (max) and theres no difference in quality between that and a TGA




Top
                 

Boink!
Boink!
Joined: 19 Apr 2003
Posts: 4493
PostPosted: 05-22-2015 08:23 PM           Profile Send private message  E-mail  Edit post Reply with quote


I recently noted how well TGA files actually pack in zip files, i.e. pk3 files. So the size issue of TGA is a lot less worse than iz initially might look as compared to JPG. Plus TGA does not use lossy compression. Many of the artists thus prefer to use TGA images for their original textures. And since JPG uses compression I would also imagine that "decompessing" the JPG textures for use on the GPU would tax the CPU somewhat more. But since the engine is so old and our hardware so powerful now, it should be irrelevant in either case.

So as was mentioned, if you do not need transparency, i.e. an alpha channel in your texture, convert them to highest quality JPG... 97% sounds fine.




Top
                 

Trainee
Trainee
Joined: 20 May 2015
Posts: 32
PostPosted: 05-23-2015 05:10 AM           Profile Send private message  E-mail  Edit post Reply with quote


map: Industrial by Hipshot (industrial.pk3)
size: 45.308kb; optimized: 23.971kb; percent: -47%

map: La Petite by cityy (ct3_20b2.pk3)
size: 54.828kb; optimized: 32.513kb; percent: -40.7%

map: The Edge of Forever by Sock (moteof_final2.pk3)
size: 50.455kb; optimized: 34.035kb; percent: -32.5%

map: Rustgard by Hipshot (rustgard.pk3)
size: 33.976kb; optimized: 23.743kb; percent: -30.1%

map: Freestyle Academy by Morbus (AMT-Freestyle6.pk3)
size: 42.209kb; optimized: 30.922kb; percent: -26.7%

map: Goldleaf by Pat Howard (goldleaf.pk3)
size: 10.618kb; optimized: 7.850kb; percent: -26%

map: Aerowalk by the Hubster (hub3aeroq3.pk3)
size: 1.223kb; optimized: 966kb; percent: -21%

map: McSarge's by cityy (ct3tourney3.pk3)
size: 106.567kb; optimized: 85.194kb; percent: -20%

As you can see, I had some "fun" with some current and classic maps.
Using Imagemagick (identify, mogrify, and convert) and jpegoptim the filesize can be heavily reduced.
Especially, when tga files w/o any alpha can actually be stored as jpg.
So maybe keep that in mind for your future mapping fun :)...

Imagemagick:
identify -verbose <filename.tga>
Look (grep) for "Type:" and it'll tell you, if the file has an alpha channel - and ofc only convert those textures w/o alpha channel.




Top
                 

Commander
Commander
Joined: 10 Apr 2015
Posts: 137
PostPosted: 05-23-2015 05:13 AM           Profile Send private message  E-mail  Edit post Reply with quote


Hmm thats a really handy way to reduce the filesize of a map. I still question weather its worth it since it takes seconds to download maps these days, but I guess if its a quick and simple process, then why not.




Top
                 

Trainee
Trainee
Joined: 20 May 2015
Posts: 32
PostPosted: 05-23-2015 05:26 AM           Profile Send private message  E-mail  Edit post Reply with quote


AndehX wrote:
Hmm thats a really handy way to reduce the filesize of a map. I still question weather its worth it since it takes seconds to download maps these days, but I guess if its a quick and simple process, then why not.


The process is pretty simple. I've written a small shell script for that. The script converts all non-alpha TGA in the current folder to JPG, creates a backup of the converted TGAs and optimize the JPG in the local folder as well.
Only thing you need is Imagemagick and jpegoptim.
The consequence of the filesize reduction is ofc that your download will be faster.
The loading times of the map/pk3 however won't change. That's totally depending on the map (BSP) and your machine.

Code:
#!/bin/bash
mkdir TGA_SOURCE
chmod 777 TGA_SOURCE
for TGA in *.tga; do
   ISTGA=$(identify -verbose "${TGA}" | grep "Type:" |grep "Alpha" | wc -l)
   if [ ${ISTGA} -eq 1 ]; then
     echo "IS TGA: ${TGA}"
   else
     echo "NO TGA: ${TGA}"
     convert -quality 100 "${TGA}" "${TGA/.tga/.jpg}"
     mv  "${TGA}" TGA_SOURCE/
   fi
done

for i in *.jpg; do mogrify  -quality 97   -filter   Lanczos $i; done
for i in *.jpg; do jpegoptim  --strip-all $i; done




Top
                 

Grunt
Grunt
Joined: 26 Jun 2019
Posts: 71
PostPosted: 10-05-2020 07:21 PM           Profile Send private message  E-mail  Edit post Reply with quote


Once, on the Internet, I accidentally found someone doing tests and checking various sizes and compression of graphic files on the quake engine, which were later checked in the game. (Quake 3 I think). He checked the differences between the source file (jpg / tga) and what we see in the game, and I have a question for everyone gathered here.
Maybe someone will have pointers to this tutorial or something like that, I was looking for, but the addresses are disappearing and it's hard to find anything now, because as you know, these are older games. I have some of these types of sites, but these are for general information only. Recently, I create textures myself and would like to know how to (finally) export them.




Top
                 

Cool #9
Cool #9
Joined: 01 Dec 2000
Posts: 44131
PostPosted: 10-05-2020 10:37 PM           Profile   Send private message  E-mail  Edit post Reply with quote


To get back to the thing I said 5 years ago, the main thing to consider here is that Quake 3 is (by now) a 20 year old game which deals with amounts of texture data that are just a drop in the ocean of available RAM. Putting a huge amount of effort in reducing texture data really gains you nothing.

As for download size, it's not 1999 anymore either. Most if not all people who still dabble around in Quake 3 / Quake Live will have broadband connections now, so downloading a map that's 20mb in size is really not an issue.




Top
                 

Trainee
Trainee
Joined: 17 Dec 2016
Posts: 28
PostPosted: 10-05-2020 11:51 PM           Profile Send private message  E-mail  Edit post Reply with quote


As far as I know, using JPG was 100% all about download and filesize. It has no bearing on in-game performance because the engine will treat it as any other data in the texture buffer. PK3 compression is more or less going to give you the same benefits as compressing your TGAs to JPGs. Not directly comparable, but pretty damn good compared to previous PAK files.

What it does really affect is loading times. TGAs will load much faster than JPGs because they are structurally much closer to what your GPU is looking for. All it basically needs to do is spew up some mipmaps and the rest is lightning-fast. JPGs need some "refactoring" done first, and then still need mipmaps.




Top
                 

Grunt
Grunt
Joined: 26 Jun 2019
Posts: 71
PostPosted: 10-06-2020 05:56 PM           Profile Send private message  E-mail  Edit post Reply with quote


I can say right away that I don't pay attention to large files (.pk3), slow internet and sluggish PC (.. these things are practically not important nowadays).
I bring this up because I am trying to make an experimental map, rather it will be exploring, not necessarily the default quake3. I care about the best graphic quality (..yes know, it's an old game :-D ...) and some textures will be stretched over the entire brushes (FIT option), because that's the idea. After taking a photo of the sample texture (3000-3000px, 5MB) I reduced it to 1024x1024, 1.5MB which looked fine. I compressed JPG (80% = 450KB), which also looked good in the editor (practically unchanged). I do not know what it will look like in the game, and as you know, the detail (quality / sharpness) in the editor differs slightly from that typically in the game (at least in my case).
[I guess I'll do a quick general test, because if there is no visual difference, but there is a size difference, I can compress JPG]
I read somewhere that TGA files look better in-game so is it possible that there will be a difference between TGA and JPG in-game on the map?
There is also the issue of (FPS), but it probably doesn't matter in this game with today's equipment.




Top
                 

This is not Æon!
This is not Æon!
Joined: 20 Jan 2002
Posts: 2222
PostPosted: 10-19-2020 09:15 PM           Profile Send private message  E-mail  Edit post Reply with quote


No one cares today, just use tga for the quality and that it's lossless, even in like 200?, uh 6? perhaps, this didn't matter...



_________________
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe


Top
                 
Quake3World.com | Forum Index | Level Editing & Modeling


Post new topic Reply to topic


cron
Quake3World.com
© ZeniMax. Zenimax, QUAKE III ARENA, Id Software and associated trademarks are trademarks of the ZeniMax group of companies. All rights reserved.
This is an unofficial fan website without any affiliation with or endorsement by ZeniMax.
All views and opinions expressed are those of the author.