Page 1 of 1

problem: converting 16bit TIF to 8bit Grayscale

Posted: 2009-04-10T10:46:43-07:00
by jun
Hello,
I am in an unfortunate situation of having to convert 16bit grayscale (single channel) TIF to 8bit grayscale BMP. ImageJ does a perfect job for this, but my IM does not (version 6.3.3). More specifically, IM 6.3.3 saves BMP only in RGB mode even with -colorspace Gray and/or -type Grayscale and/or -colors 256 options specified, resulting in 3x larger file size than desired (because of the three redundant channels R=G=B=256 grayscale).

In general, what is the right way of converting 16bit TIF to 8bit BMP with a single-channel grayscale?
Thanks,
Jun

(sorry, i posted this message in a wrong forum previously)

Re: problem: converting 16bit TIF to 8bit Grayscale

Posted: 2009-04-10T11:41:34-07:00
by fmw42
try

convert image16.tif -depth 8 -colors 256 -type grayscale image8.bmp

also see

http://www.imagemagick.org/Usage/formats/#bmp

you may need to add

convert image16.tif -depth 8 -colors 256 -type grayscale BMP3:image8.bmp


You can also try:

convert image16.tif -depth 8 -quantize gray -colors 256 +dither image8.bmp

see
http://www.imagemagick.org/Usage/quantize/#quantize