Page 1 of 1

jpg textures pros and cons

Posted: Mon Apr 06, 2015 10:39 pm
by Captaintoottoot
My two main concerns about using jpg files instead of TGA files is performance and legal issues. Please do not respond unless you are absolutely certain about the answer. Are there any legal restrictions to distributing a game that uses jpg images instead of tga? Are there any performance issues using jpg instead of tga, like, does the game decompress the jpg image to a tga format each frame or something? Slower load times? etc.

Re: jpg textures pros and cons

Posted: Mon Apr 13, 2015 9:58 am
by D-Meat
People use Jpg all over the web, so I don't think there are legal issues about using this format. Same with Targa, I think.

Tga is a lossless format and it can include an alpha channel. Using Jpg can make you save disk space, but you'll have to have your alpha / transparency channels in a separate image. Also, Heavily compressed JPG images have "glitches" that can be easily seen. This page explains it all : http://www.karbosguide.com/books/photob ... pter11.htm

If you're not constrained by disk space, I advice to use the TGA format. Once in the graphics card RAM, jpg images take as much space as TGA anyway.

Re: jpg textures pros and cons

Posted: Mon Apr 13, 2015 2:08 pm
by CZghost
@D-Meat: How can I make separate alpha channel to be used in shader? I always tought that to use transparency I need always TGA as the JPG otherwise doesn't allow transparency support. Is there any way to bypass that restriction?

Re: jpg textures pros and cons

Posted: Mon Apr 13, 2015 8:21 pm
by Eraser
Nope. No alpha channels with jpg images.

Re: jpg textures pros and cons

Posted: Sat Apr 18, 2015 8:48 pm
by D-Meat
Arf, sorry, I always used TGA images to get an alpha channel, but I thought it was possible to specify a different image for the alpha in a shader. Sorry !

Re: jpg textures pros and cons

Posted: Mon Oct 26, 2015 5:06 pm
by obsidian
TGA images compress well in .zip/.pk3, JPG images are already compressed and do not compress any further. I've often found that TGA images compressed in .zip/.pk3 format is on par (and in some cases smaller) than the same image in JPG.

There is no licensing issues with distributing images in JPG or TGA format. Software companies may need to license the JPG format to be able to open/save in JPG format, but there is no fees for end users.

I'm not sure of any performance drawbacks between using JPG vs. TGA. If anything, it's probably negligible on load times. There should be no in-game performance difference.