Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Uploading is Changing Resolution?

Jackson Drechsler
Registered User
Join date: 5 Oct 2007
Posts: 10
02-17-2008 07:53
I have another question now, I see in order to texture a planetarium dome I have to wrap a morphed texture onto it. I tried this once with some success, but now when I upload, SL changes the resolution of my 800x600 file to 512x512, which screws up the morph. How can I preserve the resolution of uploaded image files?

Thanks, -Jackson
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
02-17-2008 08:22
Jackson, I'd highly recommend you read the stickies at the top of the forum, particularly the one about texture sizes. OpenGL, the graphics language that SL is written in, requires that all textures be measurable in powers of two, always. If you try to upload an incorrectly sized texture, it will be resized to powers of two. 800x600 becomes 512x512, 123x456 becomes 128x512, etc.

Acceptable sizes are all powers of two from 8 to 1024. For best results, always presize your textures correctly in your paint program before uploading.
_____________________
.

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.
Jackson Drechsler
Registered User
Join date: 5 Oct 2007
Posts: 10
Thank you!
02-17-2008 08:31
Thanks, Chosen, I will spend the next whgile reading your stickies. This is all making sense now.

-Jackson.
Neil Robinson
kIllustrator extordinaire
Join date: 26 Oct 2006
Posts: 47
02-17-2008 08:35
Chosen is right; another interesting factor of this server-side compression/optimization is that textures made and uploaded at 800x800 will appear to be 'higher resolution' when compared to an identical texture made and uploaded at 512x512.

Don't know why. Secondlife says they're both 512x512 when you look at them in-world, but the 800 one just seems crisper.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
02-17-2008 09:48
From: Neil Robinson
textures made and uploaded at 800x800 will appear to be 'higher resolution' when compared to an identical texture made and uploaded at 512x512

Neil, what you're probably seeing is one of the natural effects of downsizing. You're not talking about "higher resolution" but about apparent higher visual quality. Often, when an image starts out large, and then is reduced in size, its appearance will seem to improve a bit. This is because the margin for error in the alignment of visual elements is reduced.

For example, let's think about a fairly large image. To keep the math simple, let's say its size is an easy number to think about, say 1000x1000. Now say you've got two rectangles in the image that you want to be in perfect alignment with each other, either horizontally or vertically, but you've botched the job, and they're off by a couple of pixels. To the eye, it will be noticeable that something is a little wrong, even if you aren't consciously aware of it.

Now, let's say you take that image and shrink it to smaller size. Again, let's pick an easy number, say 200x200. You've now removed 4/5 of the pixels in each dimension, and with them, 4/5 of the space required for those rectangles to remain out of alignment. Since they were only off by a couple of pixels to begin with, there's no longer room available for them to remain out of alignment at all.

With the misalignment now gone, your mind's eye finds the image easier to look at. And since "resolution" happens to be one of the most misused and overused words in the common lexicon these days, most people think "better looking" automatically has to mean "higher resolution". So it's easy to say to yourself, "See, the resolution just increased," even though that's not actually what happened.

In reality, the resolution in that example actually DECREASED by 96%. Or put another way, the original large image had 250 times higher resolution than the current small one. But since you feel like it looks better, you somewhat naturally, but completely erroneously, conclude the resolution must have increased.

This misunderstanding of the relationship between resolution and apparent quality is incredibly common. Far more people have it wrong than right.

Anyway, 1000x1000 to 200x200 is obviously a more extreme example than your 800x800 to 512x512, but the principle remains the same. By reducing the amount of space in the image, you bring all the elements closer together, and the composition seems to improve.


Okay, so how do you make this principle work for you?

Well, the answer is definitely NOT by deliberately uploading wrong-sized textures. That's never a good idea. SL cannot and does not do nearly as good a job of the resizing as a dedicated 2D image editor like Photoshop will. Photoshop is what you want handling all your resizing, not the SL uploader.

What you want to do is start out with a large image size in Photoshop, and then downsize it as the second to last step before final output. Don't ever upload the large size directly. Only upload the correctly downsized version. You'll get a much better result that way, always.

If you talk to most high quality texture makers, skin and clothing makers in particular, you'll find that that's how they almost always do it. Myself, I always work at 2048x2048 or sometimes even 4096x4096 when making clothes or skins. Then I downsize to 512x512 before upload.

Notice those numbers are powers of two as well, by the way. Since the output has to be a power of two anyway, working at powers of two the whole time keeps everything as clean as possible. Resizing from an arbitrary number to like 800 down to 512 will never look as good as resizing from 1024 to 512 would. Coming from 1024, you're reducing by half in each dimension, and halves are the easiest thing for the computer to divide by effectively. Coming from 800, you'd be dividing by 1.5625, which is much less efficient.

Stick with powers of two from start to finish, let Photoshop, not SL, handle all your resizings, and your images will always be as high quality as is possible.
_____________________
.

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.
Neil Robinson
kIllustrator extordinaire
Join date: 26 Oct 2006
Posts: 47
02-17-2008 10:49
Chosen - I know, I was talking about 'percieved' resolution. Thats why I put "higher resolution" in inverted commas like that. :)

In my experience though, uploading at 800x800 gives better result than uploading at 512x512 - Even if its a last step before upload to resize from 1024 or 1000 or whatever. I know PS should do it better, with bicubic resampling or whatever, but for some reason SL just seems to do it better. Weird quirk.

One other artifact of uploading at a resolution that SL downsizes, instead of doing it in PS or whatever, is the white border that occurs when you map a single texture onto a 10x10 prim at 1x1 repeates, and then use the magic wand/copy selection tool to replicate that prim, is that the same texture uploaded at 800x800 will have less of the 'border lines' that often occur when trying to do this kind of thing.

I've done a bad job of describing that so here's an image
http://farm3.static.flickr.com/2285/2272189762_fc695e570a_o.jpg - what you're looking at is the vertical white line in the middle and how it appears more harshly at 512. Thats not texture repeat, (the image is seamless at 3x3 etc) but where the edges of two 1x1 mapped prims meet.

I've no idea why its different. In any other case, or application (maya, max, etc) I'd agree with you 100% on every word of what you wrote. But for some weird-ass reason SL seems to be the exception to the rule; you're better off letting the application resize down to 512 from 800 than uploading straight 512's - even if your working image started life at 1024 or whatever.
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
02-17-2008 12:40
Hmm, I'll say a couple things about that line, Neil.

First, it really shouldn't be there at all. Most likely, it is a result of the texture not having been configured properly beforehand to tile seamlessly across a surface. That's a problem easily avoided, and just as easily corrected, in Photoshop. (If you'd like to learn how to do that, there have been lots of threads on it in this forum already, or you can certainly start a new one and ask.)

Second, assuming the above is the case, then the reason the line fades when the image is downsized by SL is exactly the behavior I described in my previous post. The line looks to have been only one pixel wide to begin with. So when the 800x800 image is downsized to 512x512, there's no longer enough room for that single pixel line to exist. Its coloring ends up being combined with the coloring of its neighboring pixels, so it appears much more faint.

When downsizing in Photoshop, the program's superior detail preservation may actually end up working against you in the presence of an accidental line like that. Since a line, any line, in most cases, is going to be something the artist would have put in deliberately, Photoshop may end up presuming that this particular one is a detail that should be preserved as best as possible during the resampling. It doesn't have any way of knowing the line was a mistake, so it works hard to keep it as visible as it can. If so, then it's a simple case of "garbage in, garbage out". Again, just make the texture properly seamless to begin with, and then there won't be any line to worry about.



It's also possible, but highly unlikely, that that white line is a result of a glitch in your graphics card and/or its drivers. If you're seeing a line like that on every texture you look at, whether you made it or not, then I'd suspect the card or the driver is malfunctioning. If it's just happening on certain ones though, which is most likely the case, then the problem is in the way the textures were made.

To test, what happens if you do your Copy Selection thing with a texture you know for a fact is seamless, like the Linden default terrain textures? Those definitely don't have lines on their edges, or you'd be seeing those lines all over the ground.

Also, what happens if instead of putting two cubes next to each other, you simply offset the texture by 50% on a single cube, to bring the edges to the middle? If you don't see the line on either texture when it's offset, then there's something funky going on with how your video card is rendering the seams where prims meet. However, since the line (predictably) fades on textures that have been downsized, that's probably not what's gonna happen. I'd be willing to bet that on your own texture, you'll see that line running down the middle of the prim when it's offset, but on the terrain textures you won't see any line at all. From there you'll know for certain that you just didn't make your own textures properly seamless.



Anyway, if you take a look a critical look at other parts of the image than just that border line, it's pretty hard to argue that the 800 version looks sharper than the 512 version. Granted, it's not an entirely fair comparison from the screenshots alone since you probably didn't have the camera in exactly the same spot relative to the textured surface for both, you probably didn't work under exactly the same lighting conditions, and you didn't frame the same part of the texture in each shot. But Even under those analytical handicaps, I still have to disagree strongly with your notion that the 800 version looks in any way better than the 512 version. To me, it looks just the opposite, in fact. The 800 version looks a little blurrier. While it's possible that the part of the texture you framed in the 800 screenshot might just happen to be a little less clear than the part shown in the 512 shot, I tend to doubt that, since I have on many occasions seen live in-world the kind of blurring that occurs on wrong-sized images, and this looks pretty much like all the rest.

The lines of the image do look smoother on the 800, so maybe that's what you're finding appealing. But the grains and other fine details look blotchier to me. To each his own, though, of course. If you prefer the look from the SL downsize, rather than the Photoshop downsize, there's nothing wrong with that. I might think you're all kinds of wrong, but you certainly don't have to agree with me. :D






P.S. Not that it matters for the subject at hand, but just for your own knowledge, those "inverted commas" are called single quotation marks. :)
_____________________
.

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.
Neil Robinson
kIllustrator extordinaire
Join date: 26 Oct 2006
Posts: 47
02-17-2008 16:46
I'll pass you a copy of the texture so that you can see for yourself, it tiles seamlessly and without the line when repeated across a single prim.

Basically,


"First, it really shouldn't be there at all. Most likely, it is a result of the texture not having been configured properly beforehand to tile seamlessly across a surface. That's a problem easily avoided, and just as easily corrected, in Photoshop. (If you'd like to learn how to do that, there have been lots of threads on it in this forum already, or you can certainly start a new one and ask.)"

As I mentioned in my post, the texture itself tiles seamlessly and without any lines when repeated across a single prim. The problem occurs when prims with the texture set to 1x1 are copyselected. Its something I've had across several computers/platforms (mac/PC, PS 6.1, 7, CS, CS2). In general I've just set my seamless textures to repeat at 0.995x0.995, this seems to fix it.

I'll pass you a copy of it, along with the PSD if you'll IM me your email address. I'd assumed from my own trial-and-error processes trying to fix it, along with conversations with my workmates (and some of yours ;) ) that it was just an SL bug. If its not something you encounter, that leads us to a new conversation.

I'd be with you on the graphics card glitch if it wasnt something i've dealt with cross platform, or in different locations. For instance, same problem whether working from the studio or at home..



And, back at you on the FYI lol - we're not all American; in the rest of Europe, they are called 'inverted commas' especially when used to signify something of dubious clarity :)
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
02-17-2008 17:06
Very interesting, Neil. Yes, it sounds like we may indeed be headed toward one of those conversations in which we discover a bug we thought had been universal only affects certain people, like the local rotation bug, and the side six bug. These things are crazy.

Yeah, please drop me a copy of an object of yours that has the line in it. I'd be really curious to see if it shows up on my end. If it does, I may take you up on your offer of examining the PSD as well.

To answer your question, yes, I generally use bicubic resampling in Photoshop when shrinking images.



As for the inverted commas, well heck, you learn something new every day, I guess. I've never heard to them referred to as that, but I'll take your word for it. In the US, they are definitely called single quotation marks, or if they're not in pairs, apostrophes. Inverted commas is a new one on me. Thanks for the educational contribution. :)
_____________________
.

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.
Neil Robinson
kIllustrator extordinaire
Join date: 26 Oct 2006
Posts: 47
02-17-2008 17:53
Cool, I'll pass it over tommorow morning - I'm just powering down for a power nap at the moment :)

One thing it could be, that has occured to me, is that it could be some sort of packet loss issue. Being in the UK its something I have to contend with across the board, for instance, I can't move as much unlinked stuff as my american chums, or change textures on as many prims without it going skitz and failing to texture them all, etc.

eg - Maybe SL loses part of the texture on the way over or something, Hence the border. But even that doesnt make that much sense, if it was a GIF or something it might (tenious), but with TGA's it just doesnt ring true. I guess an experiment I could do would be to upload a format that is built to be lossy like a jpeg and see if I still get the lines, or if it borks differently.

Anyway I'll pass the texture over to you. The one in the example is just a straight export from wood-workshop to PS at 1024 and downsized, no other editing, so it should be 'as-was' from there.
Jeremey Ryan
Registered User
Join date: 12 Aug 2006
Posts: 52
02-18-2008 19:31
I found all of this very interesting, but I do have one issue regarding the uploading process. I understand the 512X512 and resizing textures as closely as possible for uploading into SL. I am in graphic design and use Photoshop everyday, but one issue really has me wondering. I do many textures with text, and at one time, uploading at 512 seemed to be ok. The text showed up crisp and readable, no matter what font I used. But as of few months ago, I cannot upload textures with readable text. It is soft, fuzzy at times, and it doesn't seem to matter how long I let the texture load up. Its like the uploading process misses that last scan to bring in the texture clearly. As an experiment, I did a no-no and uploaded a texture as a 1024, just to see what happens, knowing full well that SL was going to downsize the file. The texture (and text) rezzed in clearly and sharply. OK, I have no clue why this is happening. So much for that. I now avoid using any text as much as possible. Once in a while, a 512 will upload with text clearly, but not very often. Any thoughts on this?

When I start a project that will be used for SL, I do start with a 1024 X 1024 document, create my project and then down size it to a 512, convert to TGA and then upload it into SL, just in case anyone was wondering. I use Photoshop 7 (PC), CS2 (Mac) and CS3 (PC). So if any of you have any tips for uploading textures with text, I'd love to hear them...Thanks!
Larrie Lane
Registered User
Join date: 9 Feb 2007
Posts: 667
02-19-2008 08:33
From: Neil Robinson
One other artifact of uploading at a resolution that SL downsizes, instead of doing it in PS or whatever, is the white border that occurs when you map a single texture onto a 10x10 prim at 1x1 repeates, and then use the magic wand/copy selection tool to replicate that prim, is that the same texture uploaded at 800x800 will have less of the 'border lines' that often occur when trying to do this kind of thing.


Neil

The white line problem you have is in your photoshop or software package you are using.
It is not a problem with the software it is only a problem that your image is actually smaller than your layers size and is not always obvious to the naked eye.
If you take your finished image and add a layer, fill this layer with a solid colour like yellow and bring your image to the front, you should see that the yellow appears on one of the sides as a very faint line.
This is the reason you are seeing the white lines after uploading. If you took a completely empty/blank layer and saved it as a TGA. file and uploaded it, SL would convert it to white and this is the white lines you are seeing, the edges or edge around your image that does not fit the layer is actually empty.
Another option, take your image and stretch it a fraction over the layer then save and upload. As you are using a pattern that should be seamless it may not be seamless but you will not see the white line as you have filled the layer. This in theory is the same method you are applying by setting the repeat values to 0.995 on your original image, you are stretching the image on the prim.
Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
A theory and a cropping question
02-19-2008 13:20
From: Jeremey Ryan
.... I do many textures with text, and at one time, uploading at 512 seemed to be ok. The text showed up crisp and readable, no matter what font I used. But as of few months ago, I cannot upload textures with readable text. It is soft, fuzzy at times, and it doesn't seem to matter how long I let the texture load up. Its like the uploading process misses that last scan to bring in the texture clearly. As an experiment, I did a no-no and uploaded a texture as a 1024, just to see what happens, knowing full well that SL was going to downsize the file. The texture (and text) rezzed in clearly and sharply. OK, I have no clue why this is happening. So much for that. I now avoid using any text as much as possible. Once in a while, a 512 will upload with text clearly, but not very often. Any thoughts on this?


I've puzzled over the same thing, Jeremey, but I haven't taken the time to document exactly what I had been doing when an uploaded texture ended up with fuzzy text. I think -- but I'm not sure -- that I've usually seen fuzzy text when I have cropped my canvas at some point so that it was no longer in "powers of two" proportions. In recent months, I've noticed that SL will sometimes resize UP instead of resizing DOWN the way it always used to. If I upload a 500x512 TGA, it will sometimes arrive as a 512x512 instead of 256x512. That means SL has stretched my image a bit ... probably not enough to be noticeable on most textures, but enough to make the delicate lines of text go a little furry. I figure that if SL always resized DOWN, I would be consistently losing data as it squishes on upload. If it sometimes resizes UP, I am gaining phony information that I can't hide easily on a prim. I'm not sure whether this half-baked theory makes sense, but it might explain what's going on.

Whether this idea holds water or not, it prompts me to ask a question I should have dealt with ages ago ... Is there a good way to crop to specific dimensions in Photoshop? That is, if I start with a photo image that is some odd dimension and I want to end up with a cropped image that is exactly 512X512 pixels, is there some easy trick to make the crop mask snap to that size?
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
02-19-2008 14:00
From: Rolig Loon
Is there a good way to crop to specific dimensions in Photoshop? That is, if I start with a photo image that is some odd dimension and I want to end up with a cropped image that is exactly 512X512 pixels, is there some easy trick to make the crop mask snap to that size?

There are lots of ways to do this, ranging from super easy to unnecessarily complicated. Here are a few:

1. Use the Height and Width fields built into the Crop tool.

When you click on the crop tool, before you actually draw your box with it, check out the tool settings bar at the top of the screen. See the fields for height and width? If 512x512 is the number you're after, just type "512 px" in each field. Now draw your cropping box, and hit Enter. This won't lock you into selecting precisely 512x512 pixels, but it will automatically resize the cropped image to 512x512, instantly.


-OR-

2. Use the Info palette.

Draw a box with the Crop tool, and keep an eye on the Info palette while you're doing it. In the right hand column, toward the vertical middle of the palette, you'll see height and width indicators. Simply drag the mouse until both indicators read 512. Note, you'll need an adequately sensitive and controllable mouse to make this work well. But of course you shouldn't be using Photoshop at all unless you have good pointing devices anyway, so that shouldn't be a big deal.


-OR-

3. Use the Rectangular Marquee tool, in Fixed Size mode

Click on the Rectangular Marquee tool, and take a look at the tool settings bar at the top of the screen. See where it says Style? By default it will be set to Normal, so you can make rectangles any size you want. Pull down the little menu there, and set it to Fixed Size instead. In the height and width fields, type 512. Now, when you draw a rectangle, it will automatically size itself to 512x512, instantly. Now, go Image -> Crop, and the canvas will crop to the size of the rectangular selection.


-OR-

4. Use the Ruler tool, and some guides

First, make sure snapping is turned on, and that Snap To Guides is enabled (View -> Snap, View Snap To... -> Guides). Now drag a vertical guide to wherever you want the left edge your 512x512 cropping to be. Grab the Ruler tool, click with it anywhere along the length of the guide, hold down shift (this will keep it straight), and drag to the right. Keep an eye on the indicators in the tool settings bar at the top of the screen. Keep dragging to the right the bar says you've got a width of 512. Let go of the mouse, and you'll see you've got an on-screen measurement beginning at your vertical guide, and terminating 512 pixels to the right of it (the little cross lines indicate the end points). Now just drag another guide, and snap it to the right side end point. Repeat the process with a couple of horizontal guides, and you'll now have 4 guides, framing a 512x512 rectangle between them. Draw a rectangle with the Crop tool, snapped to all four guides, and hit Enter.


-OR_

5. Skip the Ruler tool, and just place 4 guides in absolute positions

Go View -> New Guide. In the New Guide dialog, select Vertical, and set the guide's position to wherever you want the left edge of your cropping to be. Hit OK, and a new guide will appear wherever you specified. Now, do the same thing to create a second guide, but this time add 512 to whatever number you used last time for the position. Repeat the process to create a pair of horizontal guides. You'll now have 4 guides, framing a 512x512 rectangle between them. Draw a rectangle with the Crop tool, snapped to all four guides, and hit Enter.


-OR-

6. Place a 512x512 image in your working document, and use it as a cropping measurement.

Go File -> Place, and navigate to any image you already know for a fact is 512x512. For simplicity, try to make it an image that only has one layer in it, TGA or a JPEG or something. Hit Place and then hit Enter. The image will appear as a new layer in your working document. Ctrl-click the thumbnail for the new layer to select all the pixels on the layer. Since the placed image was 512x512, so is your selection. Go Image -> Crop to crop the canvas to the size of the selection.


I could go on all day listing other methods. There are thousands of possible ways you could do this. Personally, I like number 3 best. Go with whatever one you want, or make up a new one of your own.




On a side note, I notice the number 512x512 keeps coming up over and over again in this thread, as if that's somehow an ideal texture size. I'm sure all of us involved in the discussion realize that that's not the case, but for the sake of any newbies who might be reading, it's worth mentioning that 512x512 is just one of the many possible sizes you can use, and it's a fairly large one at that. For a complete listing of all usable sizes, plus some information on why you should always make textures as small as possible, see the sticky at the top of the forum.
_____________________
.

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
Thanks for adding to my toolbox
02-19-2008 14:51
Thanks, Chosen! Like a lot of self-taught users, there are some things I just never figured out. I should have forced myself to puzzle this one through ages ago.