[Image-SIG] ANN: PIL 1.1.4 alpha 2

K Schutte schutte@fel.tno.nl
Tue, 26 Nov 2002 09:53:12 +0100


Thanks, 16 bit support now works.

However, one problem seen: show() doesn't work on a 16 bit image; this is as
Frederik choose to delete the line below from the 'standard' modes:

*** Imaging-1.1.4a2/PIL/Image.py.org    Tue Nov 26 08:26:51 2002
--- Imaging-1.1.4a2/PIL/Image.py        Tue Nov 26 08:31:28 2002
***************
*** 161,168 ****
      # official modes
      "1": ("L", "L", ("1",)),
      "L": ("L", "L", ("L",)),
! #   @PIL88
! #   "I;16" : ("L", "I;16", ("I;16",)),
      "I": ("L", "I", ("I",)),
      "F": ("L", "F", ("F",)),
      "P": ("RGB", "L", ("P",)),
--- 161,167 ----
      # official modes
      "1": ("L", "L", ("1",)),
      "L": ("L", "L", ("L",)),
!     "I;16" : ("L", "I;16", ("I;16",)),
      "I": ("L", "I", ("I",)),
      "F": ("L", "F", ("F",)),
      "P": ("RGB", "L", ("P",)),

This means that for the example given earlier to work you have to type:

import Image
im16 = Image.open('img.tif')
min,max = im16.getextrema()
scale = 255.0 / (max - min)
offset = - min * scale
im16c = im16.point(lambda i: i * scale + offset)
im8c = im16c.convert('L')
im8c.show()

Remark: I just found out that the 16 bit image should be written in the same
endian mode as the computer itself. A quick test also revealed this to be true
for the (standard builtin) 32 bit support!

Klamer

Fredrik Lundh wrote:

> Report bugs to this list or directly to me, as usual.

-- 
Klamer Schutte, E-mail: Schutte@fel.tno.nl
Electro-Optical Systems, TNO Physics and Electronics Laboratory
Tel: +31-70-3740469 -- Fax: +31-70-3740654 -- Mobile: +31-6-51316671