Jump to content
  • 0

What is best texture setting for SL? RGB/8 or RGB/16. And .png or .targa? Targa 24/32?


Nethya Emor
 Share

You are about to reply to a thread that has been inactive for 1346 days.

Please take a moment to consider if this thread is worth bumping.

Question

I have been uploading RGB/8 .png for a good while now. Does SL support RGB/16 or RGB/32 to use for their better depth? 

Wondering if I should switch from RGB/8 to RGB/16, and exporting targa - though I am not sure what is the relation between RGB/8 bit depth and 24/32 targa bits/pixel?

Which would look best in SL and best of quality?

Link to comment
Share on other sites

Recommended Posts

  • 0

Hi Nethya,

As Rolig explained, regardless of the format of the file you upload to SL, it will be converted to JPEG2000, which is an 8 bit/channel RGBA format. I don't know if the SL texture uploader will even accept deeper formats.

A non-alpha texture has only the Red, Green and Blue channels. At 8 bit depth, that's a 24 bit pixel. If you add an Alpha (transparency) channel, that brings you up to 32 bits. As each channel is 8 bits, there are only 256 levels of brightness/transparency available. Unfortunately, that's not enough to avoid banding in shallow gradients like skies.

An RGB format supporting 16 bits per channel would result in 48 bits per non-alpha pixel and 64 bits per alpha pixel and 65,536 levels of brightness/transparency. I don't know of any output devices (including print) that can display this much dynamic range. The human eye has a dynamic range (in a single daylight scene) of somewhere in the range of 11 bits. I'm not aware of any 32 bit per channel image formats.

When you refer to RGB/16, I think of the very old (in tech terms) 5:6:5 format that produced a total gamut of 65536 colors using 5 bits for red, 6 bits for green and 5 bits for blue, for a total of 16 bits. There was no alpha channel in this format. RGB/32 refers to any of the common 8 bit/channel formats like TGA, PNG or JPEG2000.

So, stick with RGB(A)/8, that's all SL can handle. And do use uncompressed formats like PNG and TGA. You don't want to do any more compression than necessary, so let SL's JPEG2000 compressor be the only one that squishes your work.

Link to comment
Share on other sites

  • 0
4 hours ago, VeiloRieN said:

And, if we upload our textures already in JPEG2000? Will the SL engine compress it again anyway?

You can upload as JPEG, JPEG2000, TGA, BMP or PNG and avoid a re-compression.  What you have to do is to re-size your image before you upload it.  Use dimensions that are a power of 2, like 512x512, 1024x256, 128x256, etc.  Do not upload images larger than 1024x1024.

If this re-sizing results in an image that looks stretched or squashed, don't worry.  You can re-proportion it after you've uploaded.

Link to comment
Share on other sites

  • 0
7 minutes ago, Lindal Kidd said:

You can upload as JPEG, JPEG2000, TGA, BMP or PNG and avoid a re-compression.  What you have to do is to re-size your image before you upload it.  Use dimensions that are a power of 2, like 512x512, 1024x256, 128x256, etc.  Do not upload images larger than 1024x1024.

If this re-sizing results in an image that looks stretched or squashed, don't worry.  You can re-proportion it after you've uploaded.

That's not what Rolig Loon said.

Link to comment
Share on other sites

  • 0
40 minutes ago, VeiloRieN said:
49 minutes ago, Lindal Kidd said:

You can upload as JPEG, JPEG2000, TGA, BMP or PNG and avoid a re-compression.  What you have to do is to re-size your image before you upload it.  Use dimensions that are a power of 2, like 512x512, 1024x256, 128x256, etc.  Do not upload images larger than 1024x1024.

If this re-sizing results in an image that looks stretched or squashed, don't worry.  You can re-proportion it after you've uploaded.

That's not what Rolig Loon said.

I never said anything at all about compression, so don't goad me into a fight with my friend Lindal.  😉  Read my post.  The original question didn't ask about it either. I suspect that very few people upload images files as JPEG2000, because there's no particular advantage to doing that.  The system will automatically reconvert the format anyway, so you don't gain anything by getting there first. 

Now, JPEG and JPEG2000 are lossy formats, so the automatic conversion from other formats will result in some compression.  The whole idea behind those formats is to create images that save on file size by assuming that neighboring pixels with the same tonal value can be safely represented as a single larger "pseudopixel". It's done to decrease storage space and possibly improve rezzing time, although it can result in some image softening. That's different from what Lindal is talking about.  In SL, all images must have pixel dimensions that are powers of 2  (so, 8, 16, 32, 64, 128, 256, 512, 1024).  If you upload an image that has a dimension that is not a power of 2, the system will automatically adjust it by changing the dimension to the closest power of 2.   So, a 564 x 512 image will become a 512 x 512 image, with some obvious "squishing".  That's not "compression."  It's redimensioning, with some inevitable distortion.  That's why she's recommending that you always make your images with power  of 2 dimensions before you upload them, regardless of what file format you use.

Edited by Rolig Loon
typos. as always.
Link to comment
Share on other sites

  • 0
1 hour ago, Rolig Loon said:

I never said anything at all about compression, so don't goad me into a fight with my friend Lindal.  😉

Well, what a shame, I had bet L$2000 for Lindal 😜

There seems to be no consensus on the game's upload proccess engine.
I think it will be up to me to experiment with very detailed textures to test each format, and see if one really brings advantages or not.

  • Like 2
  • Haha 1
Link to comment
Share on other sites

  • 0
23 hours ago, VeiloRieN said:

And, if we upload our textures already in JPEG2000? Will the SL engine compress it again anyway?

Can you upload in JPEG2000? Not sure how I'd save JPEG2000 files anyway, but if I could I don't think I'd be able to upload them, at least not based on the Knowledge Base.

You can of course upload in old school JPEG, but I'd only do that if the original image was already a JPEG -- otherwise, why incur the lossy compression from some lossless format?

As far as I know, you can upload in any of the lossless formats (TGA, PNG, or even BMP) with exactly identical results when the JPEG2000 asset is created. It's my impression that JPEG2000 wasn't chosen for storage savings but rather for its ability to download incremental levels of detail. I guess it's better to see those blurry images while rezzing than to stare at a blank grey surface.

Because it's all going to end up JPEG2000 anyway, there's no particular reason to let either TGA nor PNG compress, options usually offered when saving an image. Both use lossless compression so nothing other than CPU time is lost, but it'll only reduce the number of bits transferred one time: when that image is uploaded.

Link to comment
Share on other sites

  • 0
3 hours ago, Qie Niangao said:

Can you upload in JPEG2000? Not sure how I'd save JPEG2000 files anyway, but if I could I don't think I'd be able to upload them, at least not based on the Knowledge Base.

You can of course upload in old school JPEG, but I'd only do that if the original image was already a JPEG -- otherwise, why incur the lossy compression from some lossless format?

As far as I know, you can upload in any of the lossless formats (TGA, PNG, or even BMP) with exactly identical results when the JPEG2000 asset is created. It's my impression that JPEG2000 wasn't chosen for storage savings but rather for its ability to download incremental levels of detail. I guess it's better to see those blurry images while rezzing than to stare at a blank grey surface.

Because it's all going to end up JPEG2000 anyway, there's no particular reason to let either TGA nor PNG compress, options usually offered when saving an image. Both use lossless compression so nothing other than CPU time is lost, but it'll only reduce the number of bits transferred one time: when that image is uploaded.

Totally agree, after some research and testing, we actually can't upload to JPEG2000, so we have to choose any lossless format. (if they set TGA as the first option in the load box ... it's for something)

Edited by VeiloRieN
  • Like 1
Link to comment
Share on other sites

  • 0
11 hours ago, Nalates Urriah said:

When SL was being built TGA was a preferred image format. While PNG was released in 1995+/- it took a bit for people to adopt it. 

TGA in SL has some transparency halo issues. To avoid those I shifted to PNG.

I still Didnt have such halo issues but is good to know it so I will be switching to png soon.

Link to comment
Share on other sites

  • 0
4 hours ago, Wulfie Reanimator said:

Transparency is transparency and all uploaded textures are converted to the same file type, so the file type you work with does not determine the alpha behavior.

You gotta spend some money on clues... https://www.robinwood.com/Catalog/Technical/SL-Tuts/SLPages/WhiteHalo1.html

5 hours ago, VeiloRieN said:

I still Didnt have such halo issues but is good to know it so I will be switching to png soon.

The Robin Wood link will give you an idea of where the problem occurs. TGAs are not bad or unusable in SL. It is just that people using them with transparency hit the halo problem. I've never been clear whether it is the SL conversion or something inherent in JPG2000 or the Kakadu library. 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

  • 0
22 minutes ago, Nalates Urriah said:

The Robin Wood link will give you an idea of where the problem occurs. TGAs are not bad or unusable in SL. It is just that people using them with transparency hit the halo problem. I've never been clear whether it is the SL conversion or something inherent in JPG2000 or the Kakadu library. 

I'm confused. That Robin Wood article seems to discuss a problem with how Photoshop combines ("flattens") multiple layers with alpha channels when exporting a (single layer) image, and it seems that TGA is just the image format used in the discussion. I've never seen anything like this happen in Gimp* when I simply export an image combining all visible 32-bit layers, and I wonder if there's a simpler way to export from Photoshop, too, that avoids all this.

(Or is there perhaps some other discussion about using PNG as the target format in Photoshop that avoids the artifacts of this strange flattening process?)

_______________
*That's not to say alpha channel manipulation is completely intuitive in Gimp, either: I still struggle with decomposing channels every time I create an emissive alpha image.

Link to comment
Share on other sites

  • 0

If you really want to go digging, @Qie Niangao, take an hour or so to wander through the ancient forum archives. In the Texturing forum, you'll find a number of interesting sticky threads in which Chosen Few discussed the ins and outs of image formats, alpha channels, white haloes, and a pile of other things.  Start with this one >>> http://forums-archive.secondlife.com/109/32/80851/1.html and then follow your nose to dig out the others.  Chosen taught a lot of us our basic texturing skills for SL.  His tutorials and forum posts all referred to Photoshop versions that are long extinct, but the principles remain the same.

  • Thanks 1
Link to comment
Share on other sites

  • 0
1 hour ago, Qie Niangao said:

I'm confused. That Robin Wood article seems to discuss a problem with how Photoshop combines ("flattens") multiple layers with alpha channels when exporting a (single layer) image, and it seems that TGA is just the image format used in the discussion. I've never seen anything like this happen in Gimp* when I simply export an image combining all visible 32-bit layers, and I wonder if there's a simpler way to export from Photoshop, too, that avoids all this.

(Or is there perhaps some other discussion about using PNG as the target format in Photoshop that avoids the artifacts of this strange flattening process?)

_______________
*That's not to say alpha channel manipulation is completely intuitive in Gimp, either: I still struggle with decomposing channels every time I create an emissive alpha image.

Is this really an issue with target format? The white halo results from creating the alpha channel from an image without addressing the fact that the "visible" part of the image is bordered by something you don't want to see. Unless you retract the border or extend the visible part of the masked object beyond the mask, you're going to get a mix of wanted and unwanted color at the mask's edge. Then I'm creating an alpha masked texture, I usually smudge the edge of the area of interest into the border. If the object shape is simple, I might just scale the image layer up by 1% to expand it just past the edge of the mask.

Link to comment
Share on other sites

  • 0
12 minutes ago, Madelaine McMasters said:

hen I'm creating an alpha masked texture, I usually smudge the edge of the area of interest into the border. If the object shape is simple, I might just scale the image layer up by 1% to expand it just past the edge of the mask.

Or, just as easy, create a cookie-cutter mask in the alpha channel that chops out the exact shape of the area to be made transparent.  The saved 32-bit TGA image won't have a white halo if you do that.  Tutorials by Robin Wood and Chosen Few describe a half dozen methods for avoiding the halo.  The nice thing about using TGA and letting an alpha channel mask do the job for you is that you can use a partial alpha (something between 0% and 100%) to create translucent or lacy fabrics and still avoid the halo problem.  That's hard to do with an image format that doesn't let you manipulate a separate alpha channel.

Link to comment
Share on other sites

  • 0
4 minutes ago, Rolig Loon said:

Or, just as easy, create a cookie-cutter mask in the alpha channel that chops out the exact shape of the area to be made transparent.

Clearly I'm not understanding what's going on here. I have had the halo problem with both TGA and PNG formats, and it's always been because I hadn't been careful enough in the creation of the mask. Shrinking the mask or extending the shape always solves the problem. Don't both TGA and PNG have alpha channels?

Edited by Madelaine McMasters
Link to comment
Share on other sites

  • 0
26 minutes ago, Madelaine McMasters said:

Is this really an issue with target format?

I don't think so, but the Robin Wood tutorial seemed to suggest that Targa export involves a funky "flatten" operation that collapses all layers onto a white background first and then applies a derived alpha channel, with the halo an inevitable result:

Quote

Halos and washed out colors happen because when Photoshop creates the Targa file, it flattens it first. (Remember, Targa files don't support layers.) It does this by dropping all the visible layers onto a white Background layer. 

Having never used Photoshop, this seemed insanely kludgy to me, and so I thought maybe it was some weird artifact of how it exports Targa, specifically, in contrast to Gimp's one-step export-to-any-format operation. But now, looking at Chosen's tutorial (thanks Rolig) I get the impression that the halo effect is all just anti-aliasing in the generation of the alpha channel boundary -- and that's certainly something one can get in Gimp, too, whether the image is exported or merely layered atop a contrasting background.

Anyway, as I claimed above, an identical image should be exported regardless of format (TGA or PNG) or something must be very wrong with the export process, and those identical exported images should look the same on import to JPEG2000 or something must be very wrong with importing. Personally I've not seen differences to suggest a format-specific problem with either process (but I only use Gimp).

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1346 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...