Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for Graphic Design professionals, students, and enthusiasts. It's 100% free, no registration required.

I have some jpg images and I need for each of them to have a transparent background.

I have GIMP as a graphic tool.

I need to put them in a web page and I need to see just the main element and have a transparent background.

share|improve this question

2 Answers 2

To expand on utopicam's answer, sometimes your image might contain areas, such as shadows, that you'd want to be semitransparent. For example, let's say you have a photo shot in a lightbox, such as this nice and freely licensed picture of a Swedish wooden toy horse courtesy of Creative Tools:

A photo of a Dalekarlian toy horse in a lightbox, licensed under CC-By 2.0 by Creative Tools

In general, the first step would be to adjust the levels of the image until the background really is solid white, except for the shadows and reflections we want to keep. (You can use this technique with a gray or colored background too, but it's a bit trickier to get good results that way.) In this case, the image is already nicely adjusted, so we don't have to do anything about that.

The next step is to select the background. This was quite easy to do with the magic wand tool, although I had to fix some bits where the white stripes on the object blend with the background with the lasso tool. Also, once I had the background nicely selected, I expanded the selection by a few pixels (at full resolution) to avoid leaving a whitish halo around the object due to aliasing. (You can't see it in this scaled-down screenshot, but I really managed to do a pretty nice job with the selection, if I may say so myself.)

Same picture with the background selected

Now, here's the trick: instead of simply cutting out the background, I used ColorsColor to Alpha to change the background color (white) to transparent. (You could also use bucket fill with the Color Erase mode as utopicam suggests.) If applied to the whole image, this would make the object look semitransparent too, but since only the background is selected, the shadows become translucent while the object itself stays opaque:

Picture after applying Color to Alpha

And here's the same picture on a pale blue background, to show the semitransparent shadows and reflections better:

Same picture on a pale blue background

One extra trick I didn't show is that it's often more convenient to make two copies of the image layer, convert the selection to a layer mask on the upper one, and apply Color to Alpha to the lower. This lets you fine-tune the edges of the object by editing the mask, while seeing live how the result will look. (Tip: make a few background layers filled with different colors, so that you can easily check how the picture looks on different backgrounds.) In particular, sometimes making highlights near the edges of the object just slightly translucent can make the result look nicer and more natural, since it mimics the background reflecting off the object.

share|improve this answer
the first step would be to adjust the levels of the image until the background really is solid white - should how to do this exactly be included for us dummies? Or should I ask a separate question on how to do that? –  hippietrail Jan 13 '13 at 1:49
@hippietrail: The levels tool generally does a pretty good job: just move the rightmost input slider left until it looks good, or use the white eye-dropper. If the cutoff looks too sharp, you can switch to "Edit these settings as Curves" and smooth it out there. (Basically, what you usually want is a curve that's mostly linear, but bends a bit near the top edge to meet it gradually rather than in a sharp corner.) –  Ilmari Karonen Jan 13 '13 at 5:45

Sounds like you need to crop certain parts of the jpgs (the main figure, for example) and delete the "background". You can do so using the lasso tool.

The gimp website has lots of tutorials and explanations. Check this http://docs.gimp.org/en/gimp-painting.html#gimp-concepts-selection and this out: http://docs.gimp.org/en/gimp-tool-free-select.html

The polygonal selection creates an anchor point every time you click. Then moving the mouse pointer draws a line with a new anchor point that you can move as long as you don't click again.

You can access the Lasso Tool in different ways:

  • From the image menu bar Tools → Selection Tools → Free Select,

  • by clicking on the tool icon in the ToolBox,

  • by using the keyboard shortcut F.

To make the solid background of an image transparent, add an Alpha channel, and use the Magic Wand to select the background. Then, use the Color Picker tool to select the background color, which becomes the foreground color in Toolbox. Use the Bucket Fill tool with the selected color. Set the Bucket Fill mode to “Color Erase”, which erases pixels with the selected color; other pixels are partially erased and their color is changed.

share|improve this answer

protected by Community May 6 at 4:38

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.