(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:Īnd here's the same picture on a pale blue background, to show the semitransparent shadows and reflections better: Now, here's the trick: instead of simply cutting out the background, I used Colors → Color to Alpha to change the background color (white) to transparent. (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.)
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.
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. The next step is to select the background. (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. 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. 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: To expand on utopicam's answer, sometimes your image might contain areas, such as shadows, that you'd want to be semitransparent.
In newer versions color to alpha doesn't exist
This tin brand the text inside a fully transparent element difficult to read: When using the opacity property to add transparency to the background of an chemical element, all of its child elements inherit the aforementioned transparency. When the mouse pointer moves away from the image, the image will be transparent once again. In this case nosotros desire the paradigm to NOT be transparent when the user hovers over information technology. In addition, we have added what should happen when a user hovers over one of the images.
The commencement CSS block is like to the code in Example 1. The opacity belongings is frequently used together with the :hover selector to change the opacity on mouse-over: Example explained