Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How we can read 16 un signed integer(16 uint) jpeg files in python

How we can read the 16 uint jpeg images in python please suggest me the libraries which can read the these type of files in python. i tried matplotlib, scipy, scikit-image, medpy ,Pil ,opencv, numpy libraries. when we are using these libraries i am getting the out put as:

raise IOError("cannot identify image file")

IOError: cannot identify image file

please help me

find the file from the link

https://drive.google.com/file/d/0B4l5GiM7kBXraDEyMXdseENfUlE/edit?usp=sharing

like image 848
Lijo Joseph Avatar asked May 29 '26 01:05

Lijo Joseph


1 Answers

Having 16-bit JPEG images sounds a bit strange, as the JPEG standard does not support 16-bit images. It has 12-bit images, though. Unfortunately, most readers only support the usual 8-bits/pixel RGB images, so even with the 12-bit images this may be a bit challenging.

One useful test could be to try:

hdr = open("myimage.jpeg", "rb").read(2)
print "{:02x} {:02x}".format(ord(hdr[0]), ord(hdr[1]))

If your file is a JPEG file, it should start with:

ff d8

If you do not get those, then the file is something else. Is there any program you can use to open the file? Which program produced the files?

like image 65
DrV Avatar answered May 31 '26 15:05

DrV



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!