[Image-SIG] ANN: PIL 1.1.4 alpha 2

Robert Klimek klimek@grc.nasa.gov
Tue, 26 Nov 2002 09:27:32 +0000


Klamer,

Thanks for the good work!  I plan to use the 16-bit capabilities soon.

Bob


On Tuesday November 26 2002 8:53 am, K Schutte wrote:
> 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 =3D Image.open('img.tif')
> min,max =3D im16.getextrema()
> scale =3D 255.0 / (max - min)
> offset =3D - min * scale
> im16c =3D im16.point(lambda i: i * scale + offset)
> im8c =3D 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 thi=
s 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.