Page 1 of 1

convert 16-bit tiff to 8-bit tiff

Posted: 2010-05-04T00:37:59-07:00
by langstrump
Hej allihop!
I want to convert a 16-bit tiff image to 8-bit:
this is the information I get about the original image with identify:
original.tiff TIFF 658x486 658x486+0+0 16-bit Grayscale DirectClass 640KB 0.000u 0:00.000

I tried the following command:
convert original.tiff -depth 8 -define quantum:format=unsigned -type grayscale test.tiff

This does not seem to work as the resulting tiff is just black.
I have no clue what could be wrong and be happy about any help!

langstrump

Re: convert 16-bit tiff to 8-bit tiff

Posted: 2010-05-04T09:44:36-07:00
by fmw42
post a link to your input image and report what version of IM you are using. what happens if you remove the -define?

What are the range of values in your tiff? If very low, then you may need to scale the result. try adding -auto-level to your command line before -depth 8

Re: convert 16-bit tiff to 8-bit tiff

Posted: 2010-05-04T14:17:41-07:00
by langstrump
Thanks a lot! I am not familiar with these image manipulation. The -auto-level option actually solved my problem.

Re: convert 16-bit tiff to 8-bit tiff

Posted: 2010-05-04T15:07:32-07:00
by fmw42
langstrump wrote:Thanks a lot! I am not familiar with these image manipulation. The -auto-level option actually solved my problem.
That is because your graylevels did not span the full 16-bit range and in fact were probably very low. When converted to 8-bits they may have been made relatively lower. The auto-level caused the input values to stretch to span the full 16-bit dynamic range so that when converted to 8-bits they still spanned the full dynamic range.