Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Color palette, JPG2000, and rezzing

Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-26-2008 17:44
Someone posed an interesting question in another forum this afternoon that I couldn't answer, so I'll pass it along. There is a clear savings in file size and in the time it takes to rez an image if you use a 512x512 image instead of a 1024x1024, or a 24-bit TGA file instead of a 32-bit one. The suggestion was made that you might realize further savings if you reduced the size of your color palette to 256 or 128 colors before uploading. Setting aside the issue of reduced image quality for a moment, would you in fact see a significant savings? Would such an image rez faster?

It seems logical that it should, but I don't know much about what happens to an image when it's converted to JPG2000 on upload. If you could upload an 8-bit PNG file with a limited color palette, for example, would you see any measureable improvement in rezzing in SL? I wouldn't consider doing this myself for anything but the simplest texture -- say a sign or a slide with only a few words on it -- but I'd be curious to know the answer anyway.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
04-26-2008 21:07
That's a good question, Rolig. I don't know the exact answer either, but I'll share what I think would happen. Assuming my thinking is right, here's how it would go.

The answer is yes, and no. The no part is that since all images in SL are RGB 24-bit or RGBA 32-bit, they all have the same palette of 16+ million colors. If you upload an 8-bit image, you simply end up with a 24 or 32-bit version of it, and some of its available colors just remain unused. The potential yes part is that since we're dealing with a compression scheme, images with less colors will result in smaller files than images with more colors. But this would only really have an impact on images with lots of colors in them, like photographs. Those that already only use just a few colors, like signs and what not, would not see any difference.

As I said, that's just what I think. It's only an educated guess, so don't take it as fact. Hopefully someone more knowledgeable on this will chime in and tell us if I'm right or not.
_____________________
.

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.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
04-26-2008 21:57
Interesting. I like your conjecture. It makes sense that reducing the palette of a photo and then uploading it and converting to JPG2000 would have a greater effect than doing the same to a simple sign that had few colors to start with, since JPEG is a compressed format. Wonder if it's correct?
Lee Ponzu
What Would Steve Do?
Join date: 28 Jun 2006
Posts: 1,770
04-27-2008 09:56
As many other discussions have speculated, there are two major components to the amount of processing required for a particular texture, 1) how much time does it take to transmit it to the viewer, and 2) how much work does it take to shuffle it in and out of the local GPU.

I think with the current generation of GPUs, the image is stored as a 24- or 32- bit uncompressed object, regardless of how easily compressed it *could* be. So using fewer colors could make the texture transmit quicker, but not help with the local GPU/CPU work.

My guiding principle in such cases is

The ONLY way to know what will happen when you change a complex system is to change the system and find out what happens.

-- George Box
_____________________
So many monkeys, so little Shakespeare.