I want to achieve the gradient mapping effect that's available in Photoshop. There's already a post that explains the desired outcome. Also, this answer covers exactly what I want to do, however
im = Image.fromarray(np.uint8(cm.gist_earth(myarray)*255))
is not working for me since I don't know how to normalize the array to values of 1.0.
Below is my code as I intend for it to work.
im = Image.open(filename).convert('L') # Opening an Image as Grayscale
im_arr = numpy.asarray(im) # Converting the image to an Array
# TODO - Grayscale Color Mapping Operation on im_arr
im = Image.fromarray(im_arr)
Can anyone indicate the possible options and ideal way to apply a color map to this array? I don't want to plot it as there doesn't seem to be a simple way to convert a pyplot figure to an image.
Also, can you point out how to normalize the array since I'm unable to do so and can't find help anywhere.