map all colors that aren't already white/gray/black, to #808080?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

map all colors that aren't already white/gray/black, to #808080?

Users mailing list
One way to do this is to remove the color to a separate layer, select it, and fill with whatever grey you like:

Duplicate the image layer.
On the duplicated layer, remove all color (Colors->Desaturate, or whatever).
Set the layer mode of the duplicated layer to Difference.
Since all black/grey/white pixels are desaturated already, the difference between the two layers will be zero, or black.
If we now remove all black pixels, we are left with only the pixels that had been colored.

Layer->NewFromVisible; make sure this new layer has an Alpha Channel (Layer-context-menu->AddAlphaChannel)
(At this point, everything but the color should be black)
In the new layer, Select the black (with a 0.0 threshhold, I imagine) and Edit->Clear. Now, all non-color will be transparent.
Invert the selection (Select->Invert).
Click on the foreground color, and make it whatever grey you like.
Edit->FillWithFGColor, and the colored areas will now all be your favored grey.
If you now only make visible (eyeball symbol on layers dock) this new layer (probably called Visible) and
your original layer, you should now have what you wanted.

(NOTE: I was testing this with merely grey/black/white areas/lines, and green/blue/red "paint"/"Airbrush"  lines.
It is possible that if a photo was used that some un-considered issue would arise that would also need to be addressed.
I was assuming a largly black/white grey image, with a bit of color.  If the image was largely colored, then
of course the resultant image would be almost completely grey...)
gimp-user-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-user-list
List archives:   https://mail.gnome.org/archives/gimp-user-list