[Image-SIG] 16 bit support

Bob Klimek klimek@grc.nasa.gov
Thu, 30 Aug 2001 17:28:40 -0400


Hello Tom,

At 09:06 PM 8/30/2001 +1000, you wrote:
>Hi
>
>Early days playing with PIL, I have added PGM support to load and save 16 
>bit images, is anyone interested in the patch (its only a few lines)?

Yes, I'm interested! Adding this capability would be a nice improvement to 
PIL. This brings up a few questions.
- Can 16-bit TIF files be also loaded?
- How do you display the image? I.e. do you display only the top 8-bits or 
do you keep all of it, interpolating down to 8-bits?
- Can you read/write a 16-bit pixel?


>
>A question was posted some time ago on this list about the behaviour of 
>the histogram method on integer images, which went unanswered. Could I 
>respectfully ask if there is much interest in extending PIL so that there 
>are working implementations of useful methods such as (for example) 
>histograms for modes I and F. This raises several implementation 
>questions, for example it becomes worthwhile caching the extreme values of 
>the image data, and a histogram of a mode F image would need to define bin 
>width as well as extremes.
>

Once again I'm interested, especially for the F format. My thinking is that 
since full support of 16-bit images in PIL would be a big undertaking, 
since most processing functions are hard-coded for 8-bits. The next best 
thing would be to read a 16-bit image and convert it to float, then you can 
do a lot of processing (employing even packages other then PIL), then you 
convert back to a 16-bit image and display.

That's my thinking, anyway. I'm curious, does this procedure sound 
reasonable or can anyone point out any flaws with this thinking?


>A last question, I have not been able to find out anything about the IM 
>image format supported by the PIL. Even my prized OReilly Encyclopaedia of 
>graphics File Formats is silent. Could anyone enlighten me?
>
>Tom Harris <mailto:TheNOSPAMPloppies@bigpond.com>TheNOSPAMPloppies@bigpond.com
>  [remove NOSPAM to reply]