Stephane Henry wrote: > Could someone point me an efficient way to transform 16 bits > greyscale tiffimage to a color image; or more simply how to create a > color image from an array of value with the possibility to choose the > palette, like the function imshow from Matplotlib.
quick recipe: - use getextrema to get the min/max value for the image (unless already known) - use point to translate the image down to an "L" image; you can use either a the argument*scale+offset form, or a 64k lookup table: http://effbot.org/imagingbook/image.htm#Image.point - use putpalette to attach a palette to the L image: http://effbot.org/imagingbook/image.htm#Image.putpalette - if necessary, convert back to RGB. </F> _______________________________________________ Image-SIG maillist - Image-SIG@python.org http://mail.python.org/mailman/listinfo/image-sig