Are there any nice ways to invert (not reverse, which is trivial, see Invert colormap in matplotlib) a colormap in matplotlib?
i.e., I want to take a png image, which has color tuples of the form (1,1,0,1)
and use a matplotlib colormap to get an integer or floating point number out.
I think I can hack together something to do this, but I can't be the first to have wanted this functionality - does it exist somewhere I couldn't find, or is it built in to matplotlib?