Creating a 1 bit tiff with good grayscale

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
GLamb
Posts: 2
Joined: 2014-06-23T06:27:46-07:00
Authentication code: 6789

Creating a 1 bit tiff with good grayscale

Post by GLamb » 2014-06-23T06:41:32-07:00

I am resizing color or grayscale bmps and then saving them as 1-bit tifs.
My final output is black and white and no grays, which is not what I want.
How do I get 1-bit tifs with true grayscaling?
Here's what I am using. Don't laugh. I am completely new to IM.
convert myfile.bmp -resize 1200x800 -colorspace Gray -type Grayscale -depth 1 myfile.tif

TIA!

snibgo
Posts: 12283
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Creating a 1 bit tiff with good grayscale

Post by snibgo » 2014-06-23T07:11:02-07:00

I'm not quite sure what you want. "-type palette" can create a 1-bit palette TIFF where the entries are, for example, grey and white.
snibgo's IM pages: im.snibgo.com

GLamb
Posts: 2
Joined: 2014-06-23T06:27:46-07:00
Authentication code: 6789

Re: Creating a 1 bit tiff with good grayscale

Post by GLamb » 2014-06-23T08:03:18-07:00

My desired result is a 1-bit tif which shows the grays, not just black and white.
Is the -depth 1 switch the only way to create a 1-bit tif?

snibgo
Posts: 12283
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Creating a 1 bit tiff with good grayscale

Post by snibgo » 2014-06-23T08:32:01-07:00

A 1-bit tiff can only contain 2 values. If an image has only 2 values, "-type palette" will make a 1-bit palette file.

EDIT: I should qualify that. I assume you want 1 bit per pixel. If so, then each pixel must be one of only two values. You can't have black, white and gray. But perhaps you mean 1 bit per channel per pixel, so 3 bits total per pixel.
snibgo's IM pages: im.snibgo.com

User avatar
whugemann
Posts: 294
Joined: 2011-03-28T07:11:31-07:00
Authentication code: 8675308
Location: Münster, Germany 52°N,7.6°E

Re: Creating a 1 bit tiff with good grayscale

Post by whugemann » 2014-06-27T02:45:55-07:00

One bit images can be dithered, if this is what you desire, see http://www.imagemagick.org/Usage/quanti ... -threshold.
Wolfgang Hugemann

Post Reply