Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

what's the story on jpeg over tga?

Damiana Domino
Pyromaniac Lovebunny
Join date: 12 Jun 2003
Posts: 222
07-23-2003 10:12
when you upload textures it gives the option of choosing either jpeg files or tga files. is there any advantage to using jpegs over tga? does it mean when someone sees your stuff it will take less time to send them the smaller textures? do all the textures you upload get changed into another format by SL anyway? would it speed things up for everyone if we use jpegs (as long as we can get good quality still)?
Ama Omega
Lost Wanderer
Join date: 11 Dec 2002
Posts: 1,770
07-23-2003 10:57
jpegs do not offer alpha layer support.

I believe everything gets changed to another format and is highly compressed before being sent out anyways.
Ian Linden
Linden Lab Employee
Join date: 19 Nov 2002
Posts: 183
07-23-2003 10:59
It's true, SL converts the images to a different format before uploading, so this choice exists purely for your convenience.
Damiana Domino
Pyromaniac Lovebunny
Join date: 12 Jun 2003
Posts: 222
07-23-2003 13:52
thank you Ama and Ian. good to know i haven't been wasting everyone's bandwidth with tga textures when i could have used jpegs. so i guess the only consideration is how much space on our home computers we want to devote to storing the stuff we make.

btw....i don't know if anyone else is aware of this but even tho the pdf says 32bit tga with alpha channel or 24bit tga you can use 16bit tga textures just fine. i *think* they don't look quite as good cause of slightly fewer colors but it could be all in my head. :)

what format are they converted too when they get to SL?
Ian Linden
Linden Lab Employee
Join date: 19 Nov 2002
Posts: 183
07-23-2003 14:23
Internally we use JPEG2000 for moving textures around - essentially a more advanced form of JPEG.
Damiana Domino
Pyromaniac Lovebunny
Join date: 12 Jun 2003
Posts: 222
07-23-2003 14:29
darn i was going to guess png. :) does photoshop support jpeg2000 yet or is it still really new?
Ian Linden
Linden Lab Employee
Join date: 19 Nov 2002
Posts: 183
07-24-2003 12:01
I don't know the status of Photoshop's support for JPEG2000, but there's no reason for you to use it for SL. I'm pretty sure SL's texture importer doesn't actually support JPEG2000. (We'd have to re-encode such a file anyway since we enforce some dimension and quality settings, and mangle the header information a little)
Mac Beach
Linux/OS X User
Join date: 22 Mar 2002
Posts: 458
07-24-2003 15:28
From: someone
Originally posted by Ian Linden
I don't know the status of Photoshop's support for JPEG2000, but there's no reason for you to use it for SL. I'm pretty sure SL's texture importer doesn't actually support JPEG2000. (We'd have to re-encode such a file anyway since we enforce some dimension and quality settings, and mangle the header information a little)
Oh, neato. I was wondering how SL dealt with all these huge texture files. Whatever conversion is being done hasn't shown up for me as the typical JPG lossy compression though.

Is it a trade secret concerning the internal dimensional limitations? If possible, for textures that I want to look best, I'd prefer to upload them at exactly the maximum values (whatever that is) or at least at some nice round lower value such as 1/2 or 1/3 maximum so as to avoid distortion, or at least distribute the distortion evenly. So if the maximum were 1024x1024 I would pick either that value, or 512, 256 or 128 etc for my originals.

As for the original posts on this: Keep in mind that if you save your work as JPG on your computer that each time you edit the file you will introduce further distortion. JPG intentionally uses "lossy" compression as a copywrite enforcement gimmick. The difference might not be noticeable on your first edit, but on your 4th or 5th it certainly will. Best to pick some other format for your originals, and now that we know that SL automatically converts from those more accurate formats, no need to use JPG at all locally.
Ian Linden
Linden Lab Employee
Join date: 19 Nov 2002
Posts: 183
07-24-2003 15:55
SL supports textures up to 2048x2048, and all dimensions must be a power of two, ie 1024, 512, 256, etc. If you try to upload a texture that's not a power of two on a side, we'll resize it. Also, all textures are converted to either 24 or 32-bit.

We are using lossy JPEG compression on all but a few (mostly UI) textures, but JPEG2000 gives us better quality than the standard JPEG algorithms.

I'd argue that lossy compression is more than a copyright gimmick - even advanced lossless formats like PNG have degenerate cases of incompressible data. Without using lossy compression, we'd have little confidence that the file size of any given image would be reasonable, but JPEG allows us to sacrifice quality to maintain a consistent compression ratio.
Mac Beach
Linux/OS X User
Join date: 22 Mar 2002
Posts: 458
07-24-2003 16:16
Thanks Ian, great info.

I wasn't aware of the degenerate compression cases. My understanding of the design goals of the JPG group was that the compression algorithm was INTENTIONALLY lossy which is why there is no lossless option built in, even though you can control the amount of loss to a large extent. The same is also true of MPEG and MP3 AFAIK.

It's a fine choice for SL internal storage. I'd still recommend against using it for storage on the originators PC, especially for textures that are going to be repeatedly edited. For photo albums or other things that I'm sure I'll never want to modify, caption, resize etc I use JPG all the time.