Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Transparent to Opaque with Gimp

Maryssa Skytower
Registered User
Join date: 5 Jul 2008
Posts: 28
10-15-2008 18:06
I have looked through the tutorials, but I didn't see anything that attacks my exact problem. Maybe what I am trying to do is not possible and that is why.

I have been taking pics in world with a white background then going to Gimp and cutting/erasing them out if I want a solid image. If I want a transparent then I just color to alpha. Instead of taking an hour or more to get a precise cut is there a way to color it to alpha and then make it opaque again? I am then taking the image and superimposing it on a background. This works on some backgrounds but not for most. If I cut it out then I always end up with a halo around the hair since I can't get it close enough. I even invert the image as it is easier to erase with it inverted but the hair is still a mystery. Setting the color to alpha makes a perfect cut but again it makes it transparent. I am new to using Gimp so I am not sure what every button does only the ones I have either learned about in tutorials or played with myself. Please help as I am at my wit's end with this.
Peggy Paperdoll
A Brat
Join date: 15 Apr 2006
Posts: 4,383
10-15-2008 18:25
I think I know what you are saying. Correct me if I'm missing it please. You are opening your image that you want to cut out then doing your cut using the add alpha to color and simply cutting out the white background. But you want to add a different background to the cut image. That's how I read what you said.

Okay, my way. I would open a completely transparent background. That puts the background on the bottom layer..........the background cannot not be moved up in the layers with GIMP (unless someone knows a trick I do not know). The transparent layer is really just a dummy layer to act as a background.........you could use any color but 100% transparent makes it easy.

Then "open as layers" from the file menu in the image window your image that you want to cut out. Do your cut. Then "open as layer" again the image or background you want to place below your cut out image. Then just move that background layer below your cut out image. Flatten or merge (whichever is appropriate) and save. It's done.

Hope I understood you correctly.
Maryssa Skytower
Registered User
Join date: 5 Jul 2008
Posts: 28
10-15-2008 18:54
That is fine if I am using a 1 color background, but because the image is transparent then whatever I put it up against shows through. I am trying to make the figure opaque again so I can put it against any background.


I am going to attach a pic to show what I mean as soon as SL stops being quirky. It looks like it is not going to work anytime soon. I am going to describe it instead. I took the image of my avatar and colored it to alpha, it is now transparent. I then opened as layers a background with a ship on it. When I place the avatar image on the ship parts of the ship then show through the body of my avatar. What I am trying to do is make it so that you cannot "see" through the avatar.
Peggy Paperdoll
A Brat
Join date: 15 Apr 2006
Posts: 4,383
10-15-2008 19:41
Are you using alpha to color? The color being your white background? I've had that problem. The hard way to get past that is simply not to add alpha to that background color....instead just use the "select by area" tool for cutting out the background (you can hold down the shift key to select more than one area). Once you cut "selected" you might have to zoom in close......I usually zoom to at least 400% and cut the little left over areas.

Another way sounds complicated but is really quite easy. Duplicate the layer you want to cut from (I usually turn off the visibility of the layer I duplicated and leaving on the duplicated copy to work with). Then go the the "colors" menu and choose "brightness and contrast"...........increase the contrast and decrease the brightness until you get the part you want to cut out contrasted more distinctly against the background. Then use the "select by area" tool to get a more sharply selected edge between the part you want and the part you don't want. Then make the layer you hid active and cut..........your edges will be more sharply cut out on that layer. Either delete or move the layer you contrasted below the layer you want to use and turn off visibility. Then try layering on your background and see if it's not better.

The problem I've found with adding alpha to color is that sometimes you wind up removing some areas that contain small amounts of the color you "alpha'd" being cut out too.........making that part semi transparent.

Hope that helps.
Jacquelin Seisenbacher
Registered User
Join date: 22 Dec 2006
Posts: 156
10-15-2008 19:44
I am wondering if this might help...
I usually take the picture against a reasonably contrasting color, something that a color select won't accidentally select half of my gown or hair with. Then, using the "magic wand" to do a color select on the background I click on that background color, then use the Select menu, go to "Grow" and set it to 1 pixel. That has, so far, eliminated that halo problem. Make sure to do this while the images are still nice and large, before you resize them down to the 512 or whatever you use in your final images. Also, those layers are a godsend. You can either do as the previous poster suggests, or you can open the image you want to use as your final background image and then open as a layer your snapshot. Then, do the color select-select-grow-1pixel thing. After that, go Layer-scale layer- and scale it to whatever you need. The most important bit of advice I've ever received with GIMP though is to always save an .xcf version of the file first (not sure if you already do this). Since it preserves all of the layers seperately. Then save a copy of your image as .tga, .jpg or whatever you use.
_____________________
"Be yourself, everyone else is already taken" Oscar Wilde



Kleineschwein by Seisenbacher ~ Clothing, Skins and more...
In world http://slurl.com/secondlife/Caledon%20Eyre/48/112/25
blog http://kleineschweinpages.blogspot.com/
Claire Harford
Inquisitive Creature
Join date: 16 Apr 2006
Posts: 49
Give this a try...
10-15-2008 20:57
“Colour to Alpha” is fantastic in some cases, not so much in others. I’ve seen the same issues as you have when using it. The images you were trying to cut out sort of becomes “ghosted” I guess. I think it’s because “colour to alpha” effects the whole canvas, not just certain sections.

You have the option of masking out the standard white background by using the fuzzy selection tool and using then “quick mask” (control+q to toggle between editing modes). Anything that comes up in red will be kept safe from editing (duh- it’s a mask hehe), anything surrounding this can then be changed. However, I just took that method for a test drive, and while it works, I didn’t personally like it too much. It still left a slight white halo issue, which is not what you want if you plan on pasting it to a new "scene".

I’m going to try and explain a way to get rid of the halo in The GIMP… it works well… but I have never seen a tutorial for it for GIMPers… so if this is hard to follow- I make apologies in advance! Photoshop does something similar, so I take no credit, this is just translating it for GIMP users.

- Take your snapshot of the model on the standard white background.
- Open it up in The GIMP.
- Grab the “fuzzy selection tool”.
(My settings for the fuzzy selection tool are anti-aliasing checked, Threshold 15.0 and select by composite.)
- Make a selection somewhere in the white background area.
- Go to Select >>> Invert (or keyboard shortcut Control+I)
- Then go to Select >>> Shrink and shrink the selection by 1px with “shrink from image border” checked.
- Now go to Select >>> Float… and create a new layer from the floating section via the layers tab.
- You should now have two layers. The top one is the one you’ll want to add in to your “scene”, the lower layer, or the old background, will be white with the halo “residue”.

This method isn’t bullet-proof, especially around area’s with a lot of transparency (alpha hair textures are a fab example of when it doesn’t work the best). But if you combine both “colour to alpha” with the “shrink and float” method, once you get used to it… you will save a LOT of time!

Let me know if that works. :) (Or if i need to review the instructions to make more sense- lol).
_____________________
Symphony Skins
SLurl: http://slurl.com/secondlife/Artisan/65/192/22

Clothes Horse
SLurl: http://slurl.com/secondlife/Artisan/75/212/22

Random Ramblings, Tips & Tricks
Blog: http://mistressofdesign.wordpress.com/
__________________

If men could only know each other, they would neither idolize nor hate.
- Elbert Hubbard