Introduction: How to Use Photoshop to Create Textures With Alpha Channels for Second Life

This will guide you step-by-step on how to make textures with transparency for Second Life using Adobe Photoshop CS. It includes tips on how to avoid blurry white outlines and a little info on masks and alpha channels.

Step 1: Overview

Making textures with alpha channels is pretty easy once you get the hang of it. There are three basic steps: Selecting your pixels, making an alpha channel from those pixels, and saving the image as a targa file with alpha channels.

Confused as to what an alpha channel is? Let me tell you a little bit about channels, masks, and transparency. An image is like a matrix of pixels. Each pixel has its own set of values for how to display it, which is usually its color. If you've ever played with a crystal prism, you know that most light can be broken down into different colors. Pixel colors are usually stored in terms of the amount of red, green, and blue. Each of these colors can be considered a "channel" or a sub-version of the image. In red-green-blue channels values can range from 0 to 100%. So each channel is a monochrome version of the image varying on how much of that color is in the image.

To complicate matters further, we can add more channels. This is useful if we want to add more information to a pixel. An alpha channel is another greyscale image that says how opaque that pixel is. White is fully opaque and black is fully transparent.

One of the great features of Photoshop is it's ability to juggle selections to channels back and forth. A selection could be considered a temporary channel. In fact the quick mask feature lets you "paint" a selection and toggle it back and forth from a temporary alpha channel to an active selection.

This tutorial will detail how to create a selection using quick mask, and how to save it as an alpha channel.

Step 2: Get a Picture

Find or Create an image you want to use as a texture. There should be no transparent pixels. Transparent pixels in Photoshop will become white when saved as a Targa file. This is the cause of a lot of annoying white borders. If possible, use the image as-is or add a background layer. Darker backgrounds seem to work best.

When you're ready, open th image In Photoshop.

Step 3: Create a Quick Mask

Press Q to toggle between normal and quick mask modes. The current mode is displayed on the Tools menu near the bottom. A white square with a white circle in it is normal mode and a grey square with a white circle is quick mask mode. Enter quick mask mode. Essentially starting off everything is selected so the mask is "white" and clear. Use the paint bucket tool to fill the mask with black. This should tint the image red. All tinted pixels are not selected and will become transparent when we make our alpha channel. Using the paintbrush tool or your tool of choice, paint the parts of the image you want to be non-tranparent white.
It's kinda confusing but:

Black:
Masked
Tinted Red In Quick Mask Mode
Not Selected in Normal Mode
Black in Alpha Channel When Created from Selection
Tranparent in SL

White:
UnMasked
Not Tinted Quick Mask Mode
Selected in Normal Mode
White in Alpha Channel When Created from Selection
Not Tranparent in SL

For this step just remember that white is opaque and black is transparent and transparency shows up as a red tint on your image. Shades of grey will become semi-transparent and will only be slightly tinted red.

Step 4: Create an Alpha Channel

Press Q to switch back to normal mode. The quick mask will become a selection. You can always edit this seection by pressing Q again. Go to the channels window (usually the tab next to layers) and press the "Save Selection As Channel" button. It looks like a grey square with a white circle. A new channel should appear called "Alpha 1." You now have an alpha channel. You can edit it directly by clicking on it and modifying it like a quick mask.

Step 5: Save As Targa

Now select "Save As.." from the file menu. (Shift + Ctrl + S) Change the format to "Targa" and make sure your file has a ".tga" extention. Make sure the Save Alpha Layers option is checked. Press Save. A window will pop up asking you for a resolution, choose 32 bit. You now have a targa image file with an alpha channel, ready for upload.

Step 6: Upload Into Second Life

From the file menu in Second Life, choose "Upload Image." Select the taga file you just created. It should show a preview version of the texture with alpha transparency. All transparent pixels will show a cherboard backdrop instead. If it suits you, pay $10 Lindens and upload the texture. Once uploaded the texture's transparency will not show up, but that's okay. It's just an SL "feature." As long as your transparency shows up in the preview, it will appear when you apply it in world.

Step 7: Tips & Closing Comments

There are many ways to create selections in Photoshop. Select-Color Range is an excellent tool if your image is against a solid color backdrop. If you have a layer with transparencies you can right click on that layer's icon and choose "select layer transparency." Put a dark background layer under that layer and use the layer transparency as your alpha layer to get rid of the "white fuzzies" you might have otherwise.

You can invert a selection with Shift+Ctrl+I or you can invert pixels with Ctrl + I.

Don't forget, there are always the lasso and magic and selection tools to play with.

If you are trying to create a flat object, I highly recomend applying a full alpha texture to the object first, then dragging your alpha textures to the face you want to apply it to.

236c39da-3bf7-25ac-b2d7-867d66616420 is a full alpha texture.

If you use a script to apply a texture or texture animation to a prim, delete it after the texture or texture animation is set. Floating text, particle systems, and animated textures are properties of a prim and persist after the script that sets them is deleted. No need to have a script running to set something that is already set.

If you want your texture to look good in SL, choose your texture height and width by powers of 2: 2, 4, 8, 16, 32, 64, 128, 256, & 512. 512x512 is usually the largest size you'd want for a texture. Bigger than that and it will take forever to load.

I hope you found this information useful, now go make SL beautiful. :D