PNG or JPEG files best for textures?

Old SketchUp forum thread, demonstrating the genesis of some innovative method of work.

tomdel

2/18/09

This might be a silly question, but are PNG or JPEG files best (or neither) for applying as textures? I have completed several models previously (7 models chosen for 3D layer) but have never actually asked the question before. I have used a combination of PNG, JPEG, even GIF files without ever bothering to find out which is better for various situations. I have just updated one of my models (MCG) but the new file is a 12mb KMZ file (exceeding the 10mb limit). I suspect it is because I used PNG files (low res, or so I thought). Can somebody please advise before I make the same mistake again?

Tom.

wtf

2/18/09

the maximum width in SU of any texture is 1076 pixels, so i would decrease your image size in photoshop to this first and compare the quality vs file size of all three. pngs are probably higher in size as they support layered translucency.

Craftsman

2/18/09

Tom,

I only use jpg and png. I only use png when I need to have transparency. I use mainly jpg because I am more familiar with editing jpg's in photoshop. Most important is to keep the image file size as small as possbile. Only use higher resolution if you believe you will be viewing the image at close range, otherwise you will not benefit from the detail. I have had good results with distant textures that are saved with a resolution of as little as 15 pixels / inch. You will be surprised at how large a sketchup file can get if your textures have a high resolution. I have had good luck finding images on the internet and generally they come in at about 72 pixels / inch. I always reduce the resolution to keep the file size as small as possible.

David

SmattUp

2/18/09

I think the maximum supported texture 1024 x 1024 (something to do with OpenGL). That might have changed with SU7. Anyway, I have not noticed any difference between jpg and png. If I need a texture with a transparency, obviously PNG is the way to go.

MazDZ8

2/19/09

> Tom,

>

> I only use jpg and png. I only use png when I need to have

> transparency. I use mainly jpg because I am more familiar with

> editing jpg's in photoshop.

>

Let me elaborate this a bit. Starting point: in most situations, say 95%, jpegs will do just fine (assuming proper compression!).When accounting for footprint, jpegs will win 98% of the time thanks to its superior image compression.

So, what is that 2-5% you need?

As stated, the first thing you need to account for is **transparency**. If you have transparency you have no choice that going for pngs as SU doesn't support any kind of "channel composition" feature (not that I consider this bad, many people wouldn't use it anyway).

The second thing is **high-frequency information**. Take for example the gradient tool in your favorite image composition SW and play with it. The gradient tool generally produces mostly low-frequency information

(colors that change slowly). This is exactly the case for which jpegs were designed for.By constast, text or stripes (or, sometimes, one edge of the default black-to-white gradient) typically contains high-frequency information. Jpgs don't cope well with them and you can easily find on the internet examples of how excessive compression happens to murder this detail.Pngs by contrast apply a completely lossless compression (it's generic data compression, as it is for example .zip) which guaranteesthe results will be always the same.

Obviously, jpegs have an huge advantage. For generic imagery and textures (which typically are within jpg's tolerances), I think I've never seen a jpeg getting beaten by png.

There's a third case in which you may want to use pngs, that is higher color precision... but the point is moot as this is mostly good for nothing.

On Feb 18, 1:42 pm, Craftsman <da...@lauchnerassociates.com> wrote:

> Most important is to keep the image file

> size as small as possbile. Only use higher resolution if you believe

> you will be viewing the image at close range, otherwise you will not

> benefit from the detail. I have had good results with distant

> textures that are saved with a resolution of as little as 15 pixels /

> inch. You will be surprised at how large a sketchup file can get if

> your textures have a high resolution. I have had good luck finding

> images on the internet and generally they come in at about 72 pixels /

> inch. I always reduce the resolution to keep the file size as small

> as possible.

I agree 100%. Ensuring your textures are correctly dimensioned is likely going to save even more than choosing the right format.And then there are the tricks. For example, windows can often be cut in half and mirrored with a single extra polygon.

Massimo

tomdel

2/19/09

Excellent responses, one and all. Thankyou. Massimo, must have taken you a while to type that up. Many thanks again.

Cheers,

Tom

Tyler

2/19/09

The default maximum texture size used in SketchUp is indeed 1024x1024. In SketchUp 7, we added an option on the Window > Preferences > OpenGL tab called "Use Maximum texture size. In some special cases where you need a very high resolution texture, you can check this box and SketchUp will allow textures sized right up to the limit of your graphics card. Note that this can really slow down rendering speeds, but in some cases like photo-modeling, it can be quite useful.

Massimo DZ8 does a great job explaining how jpg's are generally the more efficient format for textures.

Hope that helps,

Tyler

Google

georalf

2/20/09

Hello Tyler,

when a modell is accepted for the Google-Earth 3D-layer, the textures are transformed in some way (loss of quality). What happens when a texture is bigger than 1024 x 1024 px ?

I have tested png-textures a lot and discovered that it is possible to make really big (1600x1400px) png-textures with only 36KB.

The trick: Use a lot of horizontal and vertical repetition with defined colors. Like oldschool pixelstyle icons. (This is NOT possible with jpg-files)

It is a pity that these textures are reduced in quality, when put in the GE-3D-layer.

Best Regards,

Ralf.

PS: This is the modell:

https://3dwarehouse.sketchup.com/model.html?redirect=1&mid=df2e367ca218cdad5f59e6cc8c3182e0&ct=mdsa [dead link]

https://3dwarehouse.sketchup.com/model.html?redirect=1&mid=646520abbcd700f1144ddcae70ffa08d&ct=mdrm [dead link]

https://3dwarehouse.sketchup.com/model.html?redirect=1&mid=63f36231cd8672f7d5010856b07b0deb&ct=mdrm

However: png-transparency in Google Earth seems very buggy to me (at least on Mac)

Tyler

2/20/09

Hi georalf -

Excellent models! You are correct about PNG being very efficient when compressing images with lots of very high frequency data (icons as opposed to photographs). You are also correct that textures undergo some downsizing and additional compression before we serve them on the models displayed in Google Earth. We're constantly revising our algorithms to strike the best balance between model fidelity and bandwidth/serving speed. In a perfect world, we'd render the fill size textures, but currently, that would mean it would take minutes or hours for a city of 3D Buildings to download, rather than a few seconds.

Hope that helps,

Tyler