I'm trying to do the exact same thing as How can I map the colors in a greyscale image to a specific color "gradient"?, but am failing for unknown reasons. I think the real problem is that I don't understand what gradient map actually does.

To try to figure out why I wasn't getting the result I was expecting, I created a linear black and white gradient as my test image. I then used the same gradient for my map. My expectation was that my gradient would either remain the same or be reversed. The actual result was quite different, though.

Before applying Gradient Map: linear black to white gradient

After applying Gradient Map: linear grey to white then black to grey gradient

What the heck is happening? How can I get the results I expect?

1 Answer 1


I don't have the slightest idea of how you acheived that result - I just did the same thing, both in GIMP 2.8 and on a recent build of the development branch - and in both versions I got essentially the same image after mapping a white-to-black gradient to a white-to-black gradient as you did. Colors-Map->Gradient Map is the filter to use.

I tried to change the offset in the blending-tool tool options, and even played with the dynamics for color, but none of these settings affect the gradient map plug-in. It is like your mapping-to gradient was rotated (and rotating a gradient is no easy thing to do in GIMP). Can you double check what you did?

The only way I got something close to your result was by using Filters->Map->Displace which does something completely different from gradient mapping.

update As for the comments bellow, the reported behavior will happen on grayscale images in GIMP up to 2.8. It is fixed in the development branch which will eventually become GIMP 2.10.

The suggested workaround up to the release is to convert the image back to RGB before applying a Gradient Map.

  • Thanks. I thought I was really misunderstanding this tool. Good to know this result surprises more knowledgeable people. I'm using Gimp 2.8.10 on Ubuntu 14.04. These were my settings: i.sstatic.net/SVmTG.png
    – cgmb
    Commented Jun 16, 2016 at 6:38
  • This only happens in grayscale mode. Works as expected in RGB.
    – cgmb
    Commented Jun 16, 2016 at 6:51
  • Confirmed. In Grayscale mode the behavior is erratic. I made a gradient which is white with just a black stripe in the middle and the mapping creates a uniform 50% gray... Could be a bug...
    – xenoid
    Commented Jun 16, 2016 at 8:58
  • Thank you to whoever reported this as a bug on GIMP at bugzilla.gnome.org/show_bug.cgi?id=767745 - this is "the right thing to do" in these cases. As the bug is no longer present in the development version, it was closed. (This plug-in has undergone extensive refactoring to make use of GIMP's new color capabilities)
    – jsbueno
    Commented Jun 17, 2016 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.