Page 1 of 1

Converting 16bit raw data to Tiff results in black image (but with the data still in there, just squished?)

Posted: 2015-07-30T11:38:12-07:00
by HoloPed
Hey all,
I have raw bytes in a binary file. Each pixels is two bytes.
I'm using this command to convert it into TIFF:

Code: Select all

 convert.exe  -size 1200x1024 -depth 16 -endian LSB gray:rawFile -compress lzw tiffName.tif 
The resulting image is black, but if I open it in Photoshop and do auto-levels, it's all there.
What am I missing ?

Re: Converting 16bit raw data to Tiff results in black image (but with the data still in there, just squished?)

Posted: 2015-07-30T12:51:15-07:00
by dlemstra
Can you add a link to your rawFile? And what is your IM version and platform?

Re: Converting 16bit raw data to Tiff results in black image (but with the data still in there, just squished?)

Posted: 2015-07-30T13:19:32-07:00
by fmw42
Do the same as in PS. Use -auto-level.

Code: Select all

convert.exe  -size 1200x1024 -depth 16 -endian LSB gray:rawFile -compress lzw -auto-level tiffName.tif
Your tiff may have for example 10 bit range of data but in a 16-bit image format. So you could multiply by the appropriate amount as well using -evaluate multiply X


What do you get from running

identify -verbose tiffName.tif

after running your command line without the -auto-level

Re: Converting 16bit raw data to Tiff results in black image (but with the data still in there, just squished?)

Posted: 2015-07-30T14:15:06-07:00
by snibgo
Looking at the minimum. maximum and mean values should provide some insight.

Another possibility, in addition to the above comments, is that data is linear RGB rather than non-linear sRGB.

To test for this, after "-auto-level", insert "-set colorspace RGB -colorspace sRGB". This will lighten mid-tones. If the result looks better, then keep this change. If it looks worse, remove it.