Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Downsizing Textures, and Keeping Detail

Robin Sojourner
Registered User
Join date: 16 Sep 2004
Posts: 1,080
11-05-2009 02:09
Hi Everyone!

I'm moving this discussion here from the Sticky, in case the person who was frustrated by not getting an answer he could use there would like to come back to the forums, and try again. :D

His question involved planning your images when you know that they are going to be downsized (and got sidetracked into a fairly heated discussion about the relevance of ppi. We're not going to go there.)

So, I do most of my work at 1024, and downsize to either 512, for clothing or textures that are going to be showing very large on the screen, or 256 for other textures. Very, very rarely I'll use 1024 for something like a mosaic, non-repeating floor. When I do, I work at 2048.

In most graphics and texturing work, of course, it's a given that you'll work at the size of the finished image, so that you can see what you're getting when you get it.

SL is different, because of the necessity of matching seams and things. If you work large, and then downsize, small errors go away in the downsizing process.

But, of course, small details do as well.

So, that's what this discussion is about.

Personally, for most things, I don't worry about it too much. I have in the back of my mind that it's pointless to draw a 1 pixel line anywhere, and after all these years of working in SL, I have a feeling for about the level of detail I'll wind up with in the finished piece.

If detail is important, I sometimes run the Sharpen filter (not unsharp mask, regular Sharpen,) and then Fade it by 50% or so, after making a copy of the image, flattening, and reducing the size.

I always make a copy and flatten, by the way, before reducing; because otherwise some of the Layer Styles (Effects) and things can change. Since I'm way to lazy to mess with .png in most cases, flattening is a great way to make sure that I'm keeping the things I built into the image. It's not going to affect the Alpha channel, of course, and I'm not flattening onto white, (I put in layers to make sure there's no checkerboard before I get to that point) so I never get a halo.

it's important to keep the layers, though, so I make a copy first, and then flatten and resize that. Best of both worlds!

Also, depending on the image in question, I'll use different algorithms to reduce the size. PS CS4 gives you a choice of 5, and kindly labels them right in the dialog, so you can see that, for instance, Bicubic is best for smooth gradients, and Nearest Neighbor will preserve hard edges.

So if I'm doing something that has sharp lines in it, I'll use Nearest Neighbor, and so on.

You do have to watch, though, because PS will continually default to Bicubic. If you want something else, you'll have to remember to change it.

So, that's what I do.

What do the rest of you guys do?
_____________________
Robin (Sojourner) Wood
www.robinwood.com

"Second Life ... is an Internet-based virtual world ... and a libertarian anarchy..." Wikipedia
Robin Sojourner
Registered User
Join date: 16 Sep 2004
Posts: 1,080
11-05-2009 02:14
Well, bother! The forum said there was an error, and it couldn't post, and then it did anyway!

I'm doing what I can to fix it. Sure wish there was a way to remove unwanted posts!
_____________________
Robin (Sojourner) Wood
www.robinwood.com

"Second Life ... is an Internet-based virtual world ... and a libertarian anarchy..." Wikipedia
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
11-05-2009 04:59
1. Over sharpen some areas before reduction.
2. Pixel paint some detailed contrast back in after reduction.

Really, that's about it. It's very rare that I worry about the interpolation method and things. This is one of those things that I tend to keep very simple.

edit:

Oh, sometimes I work big and sometimes I work at regular dimensions. No real pattern, just whim.
Namssor Daguerre
Imitates life
Join date: 18 Feb 2004
Posts: 1,423
11-05-2009 06:58
Robin, can you elaborate on why you choose to use the standard Sharpen filter over the Unsharp Mask filter?
Daniel Dunderdale
builder/photoshop novice
Join date: 1 Jul 2006
Posts: 29
11-06-2009 02:34
I have a question :) . Since i`ve first started coming on this board to learn things about photoshop , i`ve been reading that 1024 or 2048 is good dim` to start with and then reduce in size before using in sl. I understand :) But my question is why use 1024 instead of a easy number to use like 1000 or 2000?. If i layout a grid pattern or anything where i want my guides or grid evenly spaced ,specific size, it`s much easier for me to divide it up from say a 1000 or 2000 size then reduce for secondlife. I`m just curious in asking this , i would think there is some reason for using divisions and multiples of 512
thanks , dani :)
_____________________
"If we knew what we were doing, it wouldn't be called research."--Albert Einstein
Wolwaner Jervil
SL Guided Tours
Join date: 21 Dec 2006
Posts: 119
11-06-2009 04:23
you are right, Dani,
SL uses "Power of 2" values up to 1024.
Colthing textures are internally represented as 512x512 Pixels, so working with 1024 or even 2048 at first is a good value.

Wol,
SL Guided Tours
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
11-06-2009 11:09
From: Daniel Dunderdale
But my question is why use 1024 instead of a easy number to use like 1000 or 2000?


Most things in computing are binary, so most items used in computing are measurable in powers of two. For example, a lot of people don't realize this, but a kilobyte is not actually 1000 bytes; it's 1024 bytes. And a megabyte is 1024 kilobytes, not 1000 kilobytes, and not 1 million bytes.

Textures follow this same rule. It's all about powers of two.

1000 or 2000 might seem like "easy numbers" to you as a typical human who's been raised on powers of ten. But think about it in terms of application, and it's not hard to see why numbers like that would actually make things more complicated, not less.

Say you start with a nice round number like 500. Now say you want to cut it half. No problem, right? You get 250. Well, let's say that's still too big, so you cut it one more time, and you get 125. That still works. But where do you go from there? If you were try to cut it in half one more time, you'd get 62.5. That doesn't work. There's no such thing as half a pixel.

Now let's do the same thing, except starting with 512 this time instead of 500. Cut it in half, and you get 256. Go again, and now it's 128. One more time, and it's 64. Then 32, then 16, then 8, then 2, and finally, 1. You see, from this perspective, powers of two are the "easy" numbers, and powers of ten are the "difficult" ones.

If we'd all been taught powers of two in grade school instead of powers of ten, this would all seem really obvious right away. But we happen to have 10 fingers, so powers of 10 long ago became the math we commonly use in our every day lives. Powers of two, therefore, can seem a little strange when we first encounter them.

But consider that we do use non-power-of-ten numbers all the time as well, and we don't even think about it. We've got no problem thinking in base-60 when it comes to measuring time in seconds and minutes. And then somehow we go to 24 for hours, which makes absolutely no sense, but we do it. Also, here in the US, we sure do like our 12 inches per foot, our three feet per yard, and our 5280 feet per mile, none of which is practical or logical, but we think nothing of it.

When we Americans are presented with systems that actually do make perfect sense, like the metric system (Royale with cheese!), we tend to hate it. We're a crazy, crazy people.

Anyway, texturing in powers of two is not just an SL thing, so you know. It's common practice across the industry. In fact, it was a strict requirement for decades, across nearly all platforms. Modern implementations of OpenGL and other graphics programming languages have softened that requirement somewhat in recent years, but there's still a lot of hardware out there that does require powers of two. If I remember correctly, LL did experiment with allowing non-power-of-two sizes for while, but quickly abandoned the experiment when graphics cards started crashing as a result.


From: Daniel Dunderdale
If i layout a grid pattern or anything where i want my guides or grid evenly spaced ,specific size, it`s much easier for me to divide it up from say a 1000 or 2000


It's actually no harder to make a grid for a power of two than for any other size. The reason you find it easy with sizes like 1000 or 2000 is simply because you were raised to think in powers of ten, so you're instinctively setting up your grid in powers of ten as well. Start thinking in powers of two instead, and you'll have a much easier time.

I keep my grid preferences in Photoshop set to put a gridline every 128 pixels, with 4 subdivisions in between. This makes it really easy to divide just about any power-of-two sized canvas into halves or quarters or eighths, very quickly.

If I want to divide into tenths, it's not going to work, obviously. But why would I want to do that, any more than I'd want to divide into thirds or sevenths or any other arbitrary number? Halving is a lot more useful than tenthing or thirding or seventhing.


The logic fails a little is in SL's somewhat sloppy implementation of repeats and offsets in the editor, which is unfortunate. There they've got us dividing by tens, which is just plain silly. I guess they wanted to make it easy for the layman to understand at first glance. But in doing so, they made the thing infinitely harder to actually use than it should have been.

The texture alignment pattern I published on this forum is divided in powers of ten, just to match what's going on in the editor. If I were able to do it any way I wanted, I would have put 16 numbered squares on it instead of 10. But that would have made the patten difficult to use in conjunction with the editor, so it wasn't a viable option.

When I made that pattern, I did start with a 1000x1000 pixel canvas. I then upsized it to 1024x1024 before upload. The division is not pixel-perfect, which you can tell if you inspect the image closely. But it's as close as it possibly can be.


By the way, the editor isn't the only place LL goofed, in my opinion. Check out the number of quads that make up any "round" object in SL. Cylinders, tubes, spheres, etc., all have 24 sides. This can make for somewhat awkward application of textures. How do you divide a power of two by 24? You can't.

Had they gone with 32 sides instead of 24, a lot of things would be easier today, including LOD calculations. But I suppose they wanted to keep the max poly count as low as they could. 32 was probably too high for their liking, and 16 wouldn't have made for very convincing rounds, so they met in the middle with 24.

And don't even get me started on whatever bonehead came up with the profile pic sizes.
_____________________
.

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.
Abu Nasu
Code Monkey
Join date: 17 Jun 2006
Posts: 476
11-12-2009 23:29
A few days ago I remembered something. I'm finally getting to it.

Many years ago had a very similiar conversation. This guy was having a problem working big and sizing down. The problem was previewing his big working document.

Let's say that your final output is 512 and your working doc is 1024. Let's say that you are working on 1024 and you are zoomed @ 50%. Theoretically, you will be looking at your final output on your screen.

Well, that's not exactly true. When you actually down size the rastor, you are doing things on a particular level. When you zoom and down size on your screen, you doing things on a different level. When you down size rastor, you have different methods to choose from, cubic, linear, et al. When you down size on your screen, what method is being used? Bi-linear as far as I know, and bi-linear can be a far cry from bi-cubic.

Know what I mean?

Chances are you won't notice the difference unless you are doing something uber sensitive or your eyes are that well trained.

edit:

What was I thinking? Nearest neighbor.
Namssor Daguerre
Imitates life
Join date: 18 Feb 2004
Posts: 1,423
11-13-2009 12:46
From: Abu Nasu
A few days ago I remembered something. I'm finally getting to it.

Many years ago had a very similiar conversation. This guy was having a problem working big and sizing down. The problem was previewing his big working document.

Let's say that your final output is 512 and your working doc is 1024. Let's say that you are working on 1024 and you are zoomed @ 50%. Theoretically, you will be looking at your final output on your screen.

Well, that's not exactly true. When you actually down size the rastor, you are doing things on a particular level. When you zoom and down size on your screen, you doing things on a different level. When you down size rastor, you have different methods to choose from, cubic, linear, et al. When you down size on your screen, what method is being used? Bi-linear as far as I know, and bi-linear can be a far cry from bi-cubic.

Know what I mean?

Chances are you won't notice the difference unless you are doing something uber sensitive or your eyes are that well trained.

edit:

What was I thinking? Nearest neighbor.
An easy way to test that would be to screen capture your 50% zoom 1024 image and compare (difference calculation) that to the actual re sampled (Nearest Neighbor) image. Pure black should be a match. Anything else and you have two different algorithms.