Changing foreground pixel colors
1. Open image
2. Duplicate layer (We'll be working on the duplicate, in case of flubs)
3. Select bottom layer
4. New Layer - White (since you want a white background). This will now be the middle layer.
5. Make only the top layer visible (click on the eyeball symbol in front of the other two layers)
6. Select top layer (the duplicate of the original image)
7. Add Alpha Channel (Layer->Transparency->AddAlphaChannel or Layer context menu -> AddAlphaChannel)
8. Select-by-color and click on a white area
9. Edit->Clear (white areas will disappear, replaced by transparency checkerboard pattern)
10. Select->Invert
11. Paint - only the areas that are black are selected, so only they will accept the painted colors.
All areas that were black, will be now what you paint.
12. When happy with the painting job, make the white middle layer visible again,
and export your image.