TGA files - Compress or not?
|
|
Nefertiti Nefarious
Registered User
Join date: 5 Oct 2006
Posts: 135
|
03-26-2007 12:59
I have been compressing the TGA files before upload, then read in Natalia's blog that I should not be compressing them.
The textures I have uploaded look OK, so do hers.
Is this a "don't care" issue or is there some hidden reason to not compress the TGA files?
(edited because I can't type!)
|
|
Ceera Murakami
Texture Artist / Builder
Join date: 9 Sep 2005
Posts: 7,750
|
03-26-2007 13:12
Don't compress. Uploaded files get converted to JPEG2000 fromat internally, which is a different compression algorhythm. So your compressed file gets decompressed, converted, and re-compressed. Better to just avoid the compression and eliminate two steps that can degrade your image.
_____________________
Sorry, LL won't let me tell you where I sell my textures and where I offer my services as a sim builder. Ask me in-world.
|
|
Crystal Falcon
Registered Silly User
Join date: 9 Aug 2006
Posts: 631
|
03-26-2007 14:04
TGA compression is lossless!  No degradation at all... Wikipedia's TGA pageThat doesn't loose any quality, it just says 9 1's instead of 111111111 and decompresses into the identical digital file it was before compression (unlike JPEG's lossy compression).  afaik, the only thing you gain by not compressing is a larger file size and longer upload times, which would you prefer?
|
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
Don't compress your TGA's
03-26-2007 15:35
From: Crystal Falcon TGA compression is lossless!  No degradation at all... Wikipedia's TGA pageThat doesn't loose any quality, it just says 9 1's instead of 111111111 and decompresses into the identical digital file it was before compression (unlike JPEG's lossy compression).  afaik, the only thing you gain by not compressing is a larger file size and longer upload times, which would you prefer? Crystal, no offense, but I'd suggest you do a little more detailed reading before you make such statements. Ceera's answer was the right one. Don't compress your TGA's. I'll explain why. TGA format uses RLE compression, which is only beneficial for images that contain large blocks of relatively few colors. Generally that description does not apply to the more photographic types of images commonly used for texturing. Using RLE compression on "continuous tone" images (which is what most textures are) can often result actually in LARGER file size than not using compression at all. RLE just isn't meant for this sort of thing. And so you know, what you said about upload times is not at all accurate. As Ceera mentioned, all textures are coverted to JPEG2000 at the time of upload. The conversion happens client side, so you never actually upload any TGA's at all, only JPEG2000's which are pretty highly compressed in their own right. Whether or not your source image was compressed has absolutely no bearing on the size or transmission of your outputted JPEG2000. Also, if you're really concerned about hard drive space, consider the following. The largest texture size we can use for SL is 1024x1024. A TGA of that resolution is always exactly 3 MB or exactly 4 MB in file size, depending on bit depth (the 4 MB version contains an alpha channel; the 3 MB version does not). That means a single DVD can hold anywhere between 1200 and 1600 such textures, for 10 cents. And that's if every image is as large as possible. Use more reasonably sized textures, like 256x256, and one DVD can hold well over 19,000 to 25,000 of them. Is that not enough? What's that? You don't have a DVD burner? Well, got a plain old CD burner? One CD can hold anywhere between 2600 and 3466 textures at 256x256. A $10 spindle of a hundred CD's from Walmart is enough storage for rougly 3 million textures. Is that not enough? Oh, you don't like optical media because you want you storage to be more dynamic? Gotcha. Well, how about a 16 GB Flash Drive for $200? That'll hold about 75,000 average sized textures. If you made ten new textures every day, it would take you just a hair over 20 years and six months to fill that flash drive. Need I say more?
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|
|
Namssor Daguerre
Imitates life
Join date: 18 Feb 2004
Posts: 1,423
|
03-26-2007 15:38
There is no advantage to compressing TGA files for SL. There is no harm in doing so either because it's lossles. Every texture gets converted to a lossy J2C file.
Always keep a master file on your hard drive (like PSD) because lossy compression is cumulative, and it would be a shame to have to download a compressed file to rework it again.
|
|
Crystal Falcon
Registered Silly User
Join date: 9 Aug 2006
Posts: 631
|
03-26-2007 19:14
No offense at all Chosen! Additional insights are always appreciated are they not?  LOL, my experience with RGB images and their compression dates back to 1987 (well, 24 bit in 1990), the Wikipedia entry was just a sound reference for people to get more info. (Back when we didn't compress to save loading/saving time to our floppies.) The point remains however that RLE TGA's do not degrade anything, and many people are confused that digital compression does not hurt an image (hence the OP). For textures, especially clothing, most of the image is blank, so RLE results in a savings. Just because one has a big attic doesn't mean one should store everything in boxes larger than necessary now does it?  I did not realize the JPEG2000 conversion happened client side, coolies! So there is no downside to compressing your TGAs, and IMO there's a benefit. 
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
03-26-2007 19:54
except for the fact that 6 out of 10 times it will make a slightly larger image with the sizes we use in SL, it might be a different story if your dealing with a 50 megapixel, but at that size it will be such a burden on most home pc's that few kb you might save is pointless 
|
|
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
|
03-26-2007 23:30
From: Chosen Few Crystal, no offense, but I'd suggest you do a little more detailed reading before you make such statements. Ceera's answer was the right one. Don't compress your TGA's. I'll explain why.
- lots of words snipped -
Ceera's suggestion turns out to have been the correct one in most cases, but for the wrong reasons; there's no image degradation that results from compression/decompression using RLE, as Crystal rightly pointed out. I only comment because the notion that compression automatically = degradation is a common fallacy, one worth correcting, and I hate to see useful tidbits like Crystal's post get buried in an avalanche of rebuttal that obscures an important point.
|
|
Crystal Falcon
Registered Silly User
Join date: 9 Aug 2006
Posts: 631
|
03-26-2007 23:47
Hmm... /me selects all the TGAs in a folder: 576 files for 89.58 MB compressed! Wow, so tell me again what benefit it would be to have them uncompressed, taking up over half a gig instead?  Honestly, I wasn't expecting such a dramatic difference! (Usually lossless compression only gets down 60-80% in my experience...) Did I just effectively sextuple my texture capacity in comparison? Coolies!  In all fairness, a photograph of highly detailed grass and butterfly (IE, nothing for RLE to work with) without compression saved as 769 KB versus 771 with RLE, not to be provocative but is that concern really worth it? (Never for clothing textures obviously as RLE does wonders there.) PS: Yes Anti, thanks for reinforcing the lossy vs lossless knowledge! 
|
|
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
|
03-27-2007 00:48
From: Crystal Falcon Hmm... Wow, so tell me again what benefit it would be to have them uncompressed, taking up over half a gig instead?  did you save all those as uncompressed ? in your later example your images gained 2kbish with rle, filesize /= memory so the formula doesnt work here and with a 2kb gain per image even if you got your stats backwards, 89mb doesnt baloon to 512mb its bits bytes and can be dependant on your filesystem, size on disk is how many sectors it sucks down not the actuall filesize with 32 byte clusters the differance can be a good hand full of wasted disk space (containers) vs how much the image actually takes up. rle is only worth wile in certian situations and its mostly in old computer systems and/or video systems not that i doubt you but which numbers did you look at for your CD of 500+ images, becuase i can fit 2-6x the amount of uncompressed images on a cd np
|
|
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
|
03-27-2007 01:32
From: Crystal Falcon especially clothing, most of the image is blank, so RLE results in a savings. You know, I never really thought about that. You're right. For many clothing textures, it seems there likely would be savings, perhaps even a very significant savings, since so much of the canvas tends to be just blank space. I'll say I stand corrected on this one as far as clothing textures go. For the majority texture images though, I still stand by my earlier warning that RLE will very often make the file larger rather than smaller. Unless you've got large amounts of monochromatic space in your image, RLE can't help, and most non-clothing textures don't have that. If someone's a clothing-only specialist, then perhaps RLE is worthwhile, but for the rest of us generalists, it's not viable. Even for the clothing though, I personally still don't really see the point in bothering. It won't hurt anything, of course, to use RLE, but still, since storage space is so cheap and readily available these days what is the practical benefit? As I said before, it would take you over 20 years working every day just to fill a tiny little flash drive with uncompressed TGA's. A whole hard drive would take centuries to fill. My own My Pictures folder with all my layered PSD's and everything else in it is only 15.7 GB right now, and it's got at least 4 years worth of stuff in there. I'll soften my previous statement from "don't compress your TGA's" to "don't do it unless you've got a lot of solid space in your image, and even then, consider if it's really of any tangible benefit to you."
_____________________
.
Land now available for rent in Indigo. Low rates. Quiet, low-lag mainland sim with good neighbors. IM me in-world if you're interested.
|