Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Making texture with transparent regions using GIMP

Moriz Gupte
Registered User
Join date: 25 Apr 2005
Posts: 103
08-30-2005 14:28
Hello,
I think this info may be useful to others so am posting it here. I am tempted to #$@ about the needless learning curve to do transparency stuff... but let's move on..

Goal: To create a 128x128 texture with some transparent regions using GIMP 2.2

What you need:
a. an image (128x128) in any format with a specific color to specify transparent regions
b. GIMP 2.2

1. Click on File>New to produce 'Create a New Image' dialog box
2. Type in 128 for width and height
3. Select Transparency for 'Fill With' drop down menu
4. Click ok to produce a transparent layer
5. Forget about this window for a while, we'll need it later
6. Open the image and use the 'magic wand' button, the one just after the lasso, to select the regions highlighted in the specific color
7. After selecting all the regions (to be made transparent using SHIFT+click with the magic wand tool), select Edit>Clear to remove them. Chequered boxes will appear thru the transparent regions.
8. Now save the picture as a GIF to pictureWithTransparentRegions.GIF
(there are many different ways to do 7 and 8, this is one way)
9. Now go back to the window described in 5, click on File>Open as Layer (file produced in 8)
10 Finally, save as a .tga file (you will get a prompt that you need to export the pic... click on Export)

And you could then just upload in SL

Moriz
Dianne Mechanique
Back from the Dead
Join date: 28 Mar 2005
Posts: 2,648
08-30-2005 14:33
From: Moriz Gupte
Hello,
I think this info may be useful to others so am posting it here. I am tempted to #$@ about the needless learning curve to do transparency stuff... but let's move on..

Goal: To create a 128x128 texture with some transparent regions using GIMP 2.2

What you need:
a. an image (128x128) in any format with a specific color to specify transparent regions
b. GIMP 2.2

1. Click on File>New to produce 'Create a New Image' dialog box
2. Type in 128 for width and height
3. Select Transparency for 'Fill With' drop down menu
4. Click ok to produce a transparent layer
5. Forget about this window for a while, we'll need it later
6. Open the image and use the 'magic wand' button, the one just after the lasso, to select the regions highlighted in the specific color
7. After selecting all the regions (to be made transparent using SHIFT+click with the magic wand tool), select Edit>Clear to remove them. Chequered boxes will appear thru the transparent regions.
8. Now save the picture as a GIF to pictureWithTransparentRegions.GIF
(there are many different ways to do 7 and 8, this is one way)
9. Now go back to the window described in 5, click on File>Open as Layer
10 Finally, save as a .tga file (you will get a prompt that you need to export the pic... click on Export)

And you could then just upload in SL

Moriz
Except it will be a GIF. :(

you want to save it as Targa 32 bit, not GIF.

:)
_____________________
.
black
art furniture & classic clothing
===================
Black in Neufreistadt
Black @ ONE
Black @ www.SLBoutique.com


.
Moriz Gupte
Registered User
Join date: 25 Apr 2005
Posts: 103
08-30-2005 14:35
hmm.. read carefully, in 10 I say save as .tga, and about the 32 bit I am sure... many editors do not make 24-32 bits options available for selection explicitly. And btw, just describing what works for me.
Dianne Mechanique
Back from the Dead
Join date: 28 Mar 2005
Posts: 2,648
08-30-2005 14:54
From: Moriz Gupte
hmm.. read carefully, in 10 I say save as .tga, and about the 32 bit I am sure... many editors do not make 24-32 bits options available for selection explicitly. And btw, just describing what works for me.
Sorry. Didn't see that last line.

But if you have already saved as a GIF before, then you have lost everything but 256 colours already, so it it the same thing I think. But I dont know the GIMP very well.

.
_____________________
.
black
art furniture & classic clothing
===================
Black in Neufreistadt
Black @ ONE
Black @ www.SLBoutique.com


.
Moriz Gupte
Registered User
Join date: 25 Apr 2005
Posts: 103
08-30-2005 15:41
hm... I am sorry if my post was not clear. If anyone is using GIMP 2.2 and follows steps 1-10, I guarantee that you can get something with a transparent region in SL. The method I proposed is perhaps not ideal in the sense that it relies on the GIF89a format which if I recall correctly allows the specification of only one color to be ignored by the display device. Finding that I was not able to save explicly a tga file in 32 bits, and hope somebody can clarify whether (32bits is essential for transparency, I am not convinced, hmm.. dont know to be more accurate), I just found a work around.
Namssor Daguerre
Imitates life
Join date: 18 Feb 2004
Posts: 1,423
08-30-2005 18:06
From: Moriz Gupte
hm... I am sorry if my post was not clear. If anyone is using GIMP 2.2 and follows steps 1-10, I guarantee that you can get something with a transparent region in SL. The method I proposed is perhaps not ideal in the sense that it relies on the GIF89a format which if I recall correctly allows the specification of only one color to be ignored by the display device. Finding that I was not able to save explicly a tga file in 32 bits, and hope somebody can clarify whether (32bits is essential for transparency, I am not convinced, hmm.. dont know to be more accurate), I just found a work around.


32 bits is required by SL to render things as transparent. Most image editors like GIMP, PSP, and Photoshop support this. I can't comment on the methods used because I don't use GIMP.
_____________________
martin Shaftoe
Registered User
Join date: 22 Jan 2005
Posts: 18
08-31-2005 03:22
I love you! this works alright :)
Essence Lumin
.
Join date: 24 Oct 2003
Posts: 806
08-31-2005 05:02
Moriz, I use the gimp, and have never had to do anything with gif format when dealing with transparency. Just save as .tga and it should be fine.

In case someone wants to try another way of doing things here is my usual way.
1. Click file - new, set size to 128 x 128.

2. Fill it in with your picture or whatever.

Alternatively to 1 and 2 open an existing picture with File, Open and crop it to the size you want.

3. Make a selection with the selection tool of your choice.
-
4. Click Edit, Copy

5. Click Layer, New Layer, make sure the layer fill type is set to transparency and press OK

6. Click Edit, Paste

7. Click Dialogs, Layers and press the anchor button to anchor the selection.

8. In the same dialog turn off the eye for the background.

9. Save as .tga
Georgina Amarula
Registered User
Join date: 23 Apr 2005
Posts: 3
Can Anyone Explain How to do this in PSP Please?
09-11-2005 08:35
I am struggling being able to export GIFS with transparent backgrounds into TGA files. Basically I can make a GIF image with a transparent background that isn't the problem but I just cannot get the background to stay transparent when I save as a TGA file. Please can someone detail how to do this for me, it's driving me crazy. I have PSP 9.

Many Thanks in Advance,

Geo

xx
Chosen Few
Alpha Channel Slave
Join date: 16 Jan 2004
Posts: 7,496
09-11-2005 09:29
From: Georgina Amarula
I am struggling being able to export GIFS with transparent backgrounds into TGA files. Basically I can make a GIF image with a transparent background that isn't the problem but I just cannot get the background to stay transparent when I save as a TGA file. Please can someone detail how to do this for me, it's driving me crazy. I have PSP 9.

Many Thanks in Advance,

Geo

xx

First of all, as some others have pointed out, don't use GIF. It's not compatable with SL, and it's a low quality, low color format. Stick with PSP's native format until you're finished and then export as TGA.

As I said in the last transparency thread I replied to, you're not alone in asking for help. This is the single most often asked about topic on the whole of the forums. Lindens, can we please sticky something on this already? I've been cutting and pasting the same tutorials for as long as I can remember. Don't take that personally, Geo, I'm happy to help. I just think it's really silly that so many people could benefit if the answer were right there instead of each person having to ask, but for some reason the moderators of this forum see fit not to sticky any of the numerous alpha channel tutorials that are here.

Anyway, your problem is you need to create an alpha channel. Here's my standard tutorial on how to make them, preceded by an explanation of what they are and what they do. I'm Photoshop user, so my PSP skills are somewhat limited. This is not as detailed as my Photoshop tutorial, but it should get you through what you need to do.

Color Space & Channels
Images designed to be shown on a color screen are comprised three colors (red, green, & blue). The relative brightness of each of these primary colors in each pixel determines each pixel's actual color. For example, a pixel comprised of equal values of red and blue without any green would appear to be purple.

When taken seperately, the individual values for red, green, or blue are represented by a grayscale image called a channel. In an individual channel, white represents the maximum possible concentration of color and black represents the absense of color. Shades of gray represent amounts of color that are less than the maximum. The darker the gray, the lesser the concentration of color. The lighter the gray, the more color is present. So, to go back to the example of combining red and blue values to make a splotch of purple, the splotch would appear white in the Red Channel, white in the Blue Channel, and black in the Green Channel, the reason being that the splotch contains the maximum possible values of red and blue, but no green.

Channels & Transparency (Alpha Channels)
Images that have transparency have the same three primary color channels and also have a fourth channel, called Alpha, which represents opacity. In the alpha channel, white represents comlete opacity and black represents the absense of opacity (transparency). Shades of gray represent semi-transparency. The darker the gray, the more transparent. The lighter the gray, the more opaque.

So, for example, if you are making a bikini top for your avatar, the alpha channel would be white in the shape of the bikini top, and black everywhere else. The white part makes the bikini top 100% opaque so that you won't be able to see through it when it's on the av, and the black part makes the rest of the image invisible so that there appears to be nothing on the av's arms, stomach, etc.

Creating Your Alpha Channel
Okay, now for the how-to's. I should preface this by saying my PSP skills are pretty weak compared to my Photoshop skills, but I think I can talk you through it. Just keep in mind it's been a while since I've used PSP. If any of this is inacurate or has changed since I last used it, hopefully someone else will correct me. I think everything is acurate though.

1. In Photoshop you would be able to manipulate the alpha channel directly, but in PSP you have to use a tool called a mask to serve as a proxy for what will in the end become the alpha channel. To start, go to the Mask menu and select New Mask -> Show All. The new mask will be all white (no transparency yet).

2. Go to Masks -> Edit Mask. Now you'll have a grayscale palette window so you can paint the mask varying shades of gray.

3. As I said earlier, paint the areas you want to be invisible black, paint the areas you want semi-transparent gray, and leave the areas you want completely opaque white.

4. When you're finished, go to Mask -> Save to Alpha Channel, and then delete the mask (DELETE it, do not merge it). If you need to edit the alpha later, go Mask -> Load From Alpha Channel.

5. Save your file as a 32 bit TGA and you should be all set.
_____________________
.

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.
Georgina Amarula
Registered User
Join date: 23 Apr 2005
Posts: 3
Thankyou
09-12-2005 00:26
Sorry you had to rehash all of that for the umpteenth time but ty for being so helpful, I will try this ASAP.

Geo

xx