A transparent image – by definition – does not have a background color. In fact, a normal image file does not even have a concept of "foreground" or "background". Typically, images consist of only one layer of pixels, and the color of those pixels is defined by their amount of red, green and blue. In transparent images, those pixels additionally specify an alpha-value that determines their opacity.
What I think you want is a standalone image that could somehow figure out what background it was shown on. This is technically impossible. For example, a browser will just render your transparent PNG file wherever the website specifies its location, whatever background color (or image) there happens to be. You have to generate different colors in the image for different backgrounds.
(Of course, there are more complex image formats such as a multi-layer TIFF or even a Photoshop file, in which there can be multiple layers with different overlay effects, but I understand that this is not the context of this question.)
1Transparent images don't have a background so what you are wanting to do is not possible. – DavidPostill – 2017-04-02T19:39:32.883
The general concept of having a background and an image is layering and while it is true that transparency itself won't do any tricks, professional drawing software (including The GIMP) supports layers which perform operations other than plain transparency, such as adding brightness, changing colours, etc. These can also be combined with various degrees of transparency. Since you chose the tag image-processing I believe this is the information you're looking for.
– Run CMD – 2017-04-02T20:00:01.983