[Image-SIG] Using PIL to read and write PNGs with 16 bits / band?

Nate Vack njvack at wisc.edu
Wed Nov 19 19:53:29 CET 2008


Hi all,

I'm doing some work on eyetracking data, and am interested in storing
probability maps and other stuff in PNG images. As a start, I'm using
the alpha channel to store a gaze map. I'm worried about losing
precision when doing group stats, so I'd like to use 16 bits per band.

>From what I can tell from reading past list entries and initial
source-diving, the PngImagePlugin doesn't support writing 48 or 64-bit
images. I'm less clear on this, but it seems that most of the
infrastructure is in-place to support them -- at least, the raw modes
for RGBA;16B and RGB;16B are defined and seem to get used when
reading.

What I can't figure out, though, is how (or whether) those options get
transferred over to the Image object that gets created.

So... before I go too very far down this rabbit hole, I'm wondering if
anyone knows: is this something I can make work by hacking
PngImagePlugin, or would I need to delve further into the workings of
PIL?

Thanks a million,
-Nate


More information about the Image-SIG mailing list