Read PGM's with more than 256 range in PIL1.1.7

Chris Colbert sccolbert at gmail.com
Tue Feb 9 02:08:00 CET 2010


According the pil manual it handles PGM files with "'1', 'L', or 'RGB' data"
which leads me to believe 16bit data is not supported.

You CAN write your own decoder for that though:
http://www.pythonware.com/library/pil/handbook/decoder.htm

It would be trivial to write a decoder for the pgm format.


On Mon, Feb 8, 2010 at 4:47 PM, Davo <davodavo2 at gmail.com> wrote:

> I have a PGM format image file with 4096 range.  When I reads it with
> PIL, I get an image with 8-bit values and alternate columns are zero.
> Does PIL support reading and writing PGM's with more than 8-bits?
>
> Davo
> --
> http://mail.python.org/mailman/listinfo/python-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100208/334e5c2b/attachment.html>


More information about the Python-list mailing list