How to save a NumPy array as 16-bit single channel PNG image?

Viewed 13878

I have an image in NumPy array format and I want save it to my disk. I used this code:

from PIL import Image
....
Image.fromarray(img).save('res.png')

But it saved as 8-bit. How can I make it save as 16-bit?

1 Answers
Related