question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`imread`, `imwrite` support for 16bit .png images

See original GitHub issue

If I understood correctly, imageio implements 16bit .png support via freeimage plugin. The question is: is it possible to force read/write in 16bit? Looking at the code I haven’t found an easy way to do so.

See https://github.com/scikit-image/scikit-image/issues/2436.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
almarkleincommented, May 27, 2017
# read with Pillow
imageio.imread('imageio:chelsea.png', 'PNG-PIL')
# read with FreeImage
imageio.imread('imageio:chelsea.png', 'PNG-FI')
4reactions
soupaultcommented, Jan 10, 2017

@almarklein I see, thanks!

And what about multichannel images?

In [19]: im1 = np.zeros((3,3,3), np.uint16)
    ...: im1[0,0] = 1000
    ...: 
    ...: imageio.imsave('im16.png', im1)
    ...: im2 = imageio.imread('im16.png')
    ...: 
/usr/lib/python3.6/site-packages/imageio/core/util.py:81: UserWarning: Lossy conversion from uint16 to uint8, loosing 8 bits of resolution
  warn('Lossy conversion from uint16 to uint8, '
Read more comments on GitHub >

github_iconTop Results From Across the Web

imwrite 16 bit png depth image - python - Stack Overflow
I am trying to save a 16 bit depth image which I retrieve from Kinect v1 as a png file. I wrote the...
Read more >
MATLAB imwrite - Write image to graphics file - MathWorks
If A is of data type uint16 and the output file format supports 16-bit data (JPEG, PNG, and TIFF), then imwrite outputs 16-bit...
Read more >
Image file reading and writing - OpenCV
imwrite () · 16-bit unsigned (CV_16U) images can be saved in the case of PNG, JPEG 2000, and TIFF formats · 32-bit float...
Read more >
Opencv save 16 bit image
To save an image to the local file system, use cv2.imwrite() function of opencv python library. Opencv imread 16 bit grayscale. When using...
Read more >
imread (MATLAB Functions)
The imread function also supports several other format-specific syntaxes. ... also supports reading 16-bit-per-pixel data from BMP, TIFF and PNG files.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found