- Load the image with GIMP and in the layer window; name the image layer “image“.
- Right click the layer and select “Add Layer Mask“. Select “Transfer layer’s alpha channel“, click “Add“.
- Create a new layer by hitting the “Create new layer” button in the bottom left of the layer window, call this layer “alpha“
- Left click on the alpha mask of the “image” layer (white border around right thumbnail); press Ctrl+C.
- Left click on the “alpha” layer; press Ctrl+V.
- Right click on the new temporary layer that is created, select “Anchor Layer“.
- Create a new layer with black (0×000000) and call the layer “background“.
- Order the layer like this (by left clicking and dragging the layers around):
- alpha
- image
- background
- Right click the “image” layer and choose “Merge Down“
- Right click the resulting layer and select “Add Layer Mask“. Select “White (full opacity)“, click “Add“.
- Select the “alpha” layer; press Ctrl+C.
- Select the alpha mask of “background” layer; press Ctrl+V.
- Right click on the new temporary layer, select “Anchor Layer“.
- Delete the “alpha” layer.
- Export/save as PNG.
(Source credit: How To Create Pre-Multiplied Alpha for use with OpenGL)
