![]() The next step is optional and consists in filling the area that should become transparent with a plain colour first. This is done by selecting Layer → Tranparency → Add Alpha Channel. If this is the case, add an alpha transparency channel. Some image types lack a transparency channel JPG for example. Note: This tutorial is also available in PDF. Using fast bucket fill instead of contour selection (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. This lets you fine-tune the edges of the object by editing the mask, while seeing live how the result will look. 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. (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 layer -> transparency -> add alpha channel.Import the exported image ( File -> Open.)Įxpected result: The imported image should have the same colormap as the original image.Īctual result: The imported image will have an extra color at the beginning of the colormap. Repeating this process will add even more colors to the colormap.Ĭolormap of the imported image (colors may be different): (color 0 is used in transparent areas)Ĭolormap of the image after exporting and re-importing twice: (color 0 is used in transparent areas, color 1 is now unused)Ĭreate a new image ( File -> New.) with transparency (set Fill with: under Advanced Options to Transparency)Ĭonvert the image to indexed color ( Image -> Mode -> Indexed.) (options don't matter)Įxport as a PNG image ( File -> Export As.) (options don't matter) The color values of the transparent pixels will be the new color. When exporting a PNG image in indexed color mode that contains at least one fully transparent pixel, an extra color will be added at the beginning of the colormap. ![]() ![]() Operating System: GNU/Linux (Ubuntu 20.04.3 LTS), Windows.Package: ubuntu-focal-universe (deb), flatpak, installer from (exe).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |