Question

I have a logo which contains shades of a green on a white background (and some other pale color shades, mostly gray). What I want to do is to `invert' the colors, this is, white should become green, and green should become white, and the shades inbetween should be inverted accordingly.

It's not very important what's happening with the other colors, but they should stay different from the green shades, so converting the whole image to B/W, then inverting and adjusting the luminance is a no-go.

Any idea how to do this? I would prefer formulae, but a solution with gimp would also help tremendously.

Was it helpful?

Solution

To answer my own question: Assuming my green is (r, g, b), and white is (0xFF, 0xFF, 0xFF), replacing a pixel (x, y, z) with (0xFF + r - x, 0xFF + g - y, 0xFF + b - z) did the trick good enough for me!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top