How to colorize a layer with semi transparent borders to a specific color in GIMP?

I have an white icon that needs to be colorized to a specific color. How do I do it in GIMP?

Keep in mind that it has semi transparent borders and transparent background, so using the bucket or selections is a no-go.

Also, I would appreciate if someone could extend the answer to “how to paint something that’s has transparent borders without tools that use thresholds?”, as this has been a question to me for a long time, and I really hate non seamless alternatives, like thresholds and feathering.

This is the icon:

enter image description here


What you want to do is change the color of the image while keeping the transparency intact. The solution is simple: turn the transparency into a layer mask.

Specifically, with your example image, follow these steps:

  1. Open the image in GIMP. Change the color mode to RGB (Image → Mode → RGB).

  2. Convert the transparency to a layer mask (Layer → Mask → Add Layer Mask…, choose “Transfer layer’s alpha channel” in dialog).

  3. By default, you’ll be editing the layer mask after adding it. Switch to editing the layer content either using the menu (uncheck Layer → Mask → Edit Layer Mask) or simply by clicking the left thumbnail in the Layers dialog.

  4. Paint whatever color of texture you want the logo to have over the layer content, e.g. using the Bucket Fill tool (with “Fill whole selection” selected).

  5. Save the result as PNG, optionally after reapplying the layer mask (Layer → Mask → Apply Layer Mask). If you don’t apply the mask, GIMP will do it automatically when exporting to PNG (and will pop up a dialog saying so).

Depending on what you paint over the layer content, the result might look something like, say, one of these images:

Red RGB plasma Landscape

Source : Link , Question Author : emi , Answer Author : Ilmari Karonen

Leave a Comment