I have the following image of a yellow marker. Everything around the marker is fully transparent. But the yellow and the white part inside the marker is half-transparent. I do not want any transparency inside the marker, but i want the outside-transparency to stay. How do i do this in GIMP?
GIMP: Remove half-transparency from an image and add leave full transparency-part untouched
These are the steps I took:
Select background with the select by color tool ()
Remove alpha channel (Layers > Transparency > Remove Alpha Channel). This will replace the transparency with the selected background color (usually white)
Add transparency channel again (Layer > Transparency > Color to Alpha choose white).
Delete selected background (Del)
Another way (by the way, since your white is fully opaque, I won't address it):
- Sample the yellow with the color picker
- Use the
Select by Colortool to select the yellow (this should select both the circle and the "triangle")
Select>Growby two pixels (the selection should bleed over the white and the black)
- Set the bucket-fill tool to
Behindmode (selector on top of the Tool options dialog), and to
Fill whole selection
- Bucket-fill the selection
behind mode only fills the "transparent" part of pixels (fully opaque pixels are therefore unchanged). In other words, it is equivalent to adding a layer under your current layer and filling it with the color.
- Use the fuzzy select tool to select the background.
Select>Growby two pixels, so that the selection includes the edge pixels.
Layer>Mask>Add layer maskand initialize to "Transfer layer's alpha channel"
- Bucket-fill with white (this paint should go to the layer mask)
Layer>Mask>Apply layer maskwhen you are happy with the result
GIMP and other raster image editors aren't the ideal software for such graphics. Better to look at vector image editing software such as Inkscape(dot)org which is free and Open Source. Recreating such simple graphics in vectors is easy, plus it will be better quality, and rescalable.
Anyway, you asked about GIMP, so here's one way to do it.
- Open the PNG in GIMP
- Right click the layer in the layers panel, and duplicate the layer about 4 times (see screenshot below), until you can't see through the yellow
- Layer > Merge > Visible
- File > Overwrite
If you want to keep the original, make sure you work on a copy!
By way of comparison, here's an example recreated in Inkscape, and exported as plain SVG. You can download the SVG and drag it into your browser to view it.
There is now Layer/Transparency/Threshold Alpha for anyone who finds this thread.