Greyscale Display w/PIL/tkinter

Eric Frey frey at otter.bme.unc.edu
Fri Sep 7 09:27:34 EDT 2001


I am writing an application where I need to display grayscale images on
both 8 (pseudocolor) and 24 bit displays. I am using PIL and ImageTk to
display the images. It works fine on 24 bit displays. However, it doesn't
work on 8 bit displays since there are only a very small number of gray
levels. What i would like to happen is for the application to have a
private colormap that is installed when the cursor is in the window. I
have used the colormap='new' option to a Frame that fills my root window
or to a Toplevel widget. That seems to do something, but I can't figure
out how to actually add colors to the new colormap. Any hints on how to
do this or how to get PIL to do a better job of this? Thanks.

-- 
=======================================================================
Eric C. Frey
Department of Biomedical Engineering and Department of Radiology
The University of North Carolina



More information about the Python-list mailing list