python-imaging/Pillow — pull request #625 by videan42 (2014-04-15 18:54:11+00:00)
Title: Add 16bit encode/decode to JPEG2K (WIP)

Add the ability to write 16bit JPEG2k Images (for DICOM medical images).

I'd trying to add a decoder too but I couldn't quite figure it out. Here's my dumb test case:

```python
import numpy as np
from PIL import Image

arr = np.zeros((64, 96), dtype=np.uint16)
arr[16:64, 0:32] = 300

img = Image.fromarray(arr, 'I;16')
img.save('grr.j2k') # Works

img2 = Image.open('grr.j2k')
arr2 = np.array(img2)

np.testing.assert_almost_equal(arr, arr2) # Fails
```

Thoughts?