jpg textures pros and cons

Locked
Captaintoottoot
Posts: 59
Joined: Fri Mar 28, 2014 11:50 pm

jpg textures pros and cons

Post 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.
D-Meat
Posts: 159
Joined: Tue May 17, 2011 8:52 am

Re: jpg textures pros and cons

Post 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.
[url=http://www.dmitri-engman.fr/]My blog[/url] - [url=http://dmeat.free.fr/book/]My portfolio[/url]
---------------------
[url=http://lvlworld.com/#c=m1&i=1908&d=12%20Dec%202012&m=All&p=review]MJDM2[/url] - [url=http://lvlworld.com/#c=m1&i=2108&d=12%20Dec%202012&m=All&p=review]DmeatSP01[/url] - [url=http://lvlworld.com/#c=m1&i=2132&d=12%20Dec%202012&m=All&p=review]DmeatSP02[/url]
User avatar
CZghost
Posts: 1943
Joined: Wed Jun 22, 2011 1:45 pm
Location: Czechia
Contact:

Re: jpg textures pros and cons

Post 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?
[ Linktree | Twitch | YouTube | Instagram | Websites ]
When you feel the worst, turn to the sun and all the shadows will fall behind you.” - John Lennon
User avatar
Eraser
Posts: 19177
Joined: Fri Dec 01, 2000 8:00 am

Re: jpg textures pros and cons

Post by Eraser »

Nope. No alpha channels with jpg images.
D-Meat
Posts: 159
Joined: Tue May 17, 2011 8:52 am

Re: jpg textures pros and cons

Post 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 !
[url=http://www.dmitri-engman.fr/]My blog[/url] - [url=http://dmeat.free.fr/book/]My portfolio[/url]
---------------------
[url=http://lvlworld.com/#c=m1&i=1908&d=12%20Dec%202012&m=All&p=review]MJDM2[/url] - [url=http://lvlworld.com/#c=m1&i=2108&d=12%20Dec%202012&m=All&p=review]DmeatSP01[/url] - [url=http://lvlworld.com/#c=m1&i=2132&d=12%20Dec%202012&m=All&p=review]DmeatSP02[/url]
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: jpg textures pros and cons

Post 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.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
Locked