How to Fill Semi-Transparent Pixels in GIMP
This article explains how to evenly color semi-transparent pixels in GIMP using the Bucket Fill tool and composite modes. By utilizing composite color options, you can recolor anti-aliased edges, gradients, and partially transparent elements cleanly without destroying their original alpha values or leaving behind jagged borders.
1. Select Your Target Layer and Foreground Color
Open your project in GIMP and ensure the layer containing the semi-transparent pixels is selected in the Layers dialog. Set your desired fill color as the active Foreground Color in the toolbox.
2. Activate the Bucket Fill Tool
Select the Bucket Fill Tool from the toolbox or
press Shift + B.
3. Configure the Tool Options
In the Tool Options dockable dialog, adjust the following parameters to target semi-transparent pixels correctly:
- Fill Type: Choose FG color fill.
- Mode: Set the blend mode to Color (or Color LCH for perceptually uniform luminance). This applies the hue and saturation of your selected color to the existing pixels while maintaining their lightness and alpha structure.
- Composite Mode: Change this setting from Auto to Source Atop. In the Source Atop mode, the fill is only applied to areas where existing pixels have an alpha value greater than zero, preventing the tool from bleeding into fully transparent spaces while respecting semi-transparency.
- Affected Area: Select Fill whole selection. If you do not have an active selection, this applies the fill to the entire layer boundary.
4. Apply the Fill
Click anywhere within the canvas. The Bucket Fill tool will calculate the composite color directly against the existing pixel data, tinting every semi-transparent pixel uniformly with your foreground color while keeping the original alpha gradation completely smooth.