Amandasaurus
Amandasaurus

Reputation: 60809

Imagemagick/convert monochromatic tiff file into monochromatic png file

I have a tiff file that is monochromatic. It's just black and white pixels.

When I use identify (part of imagemagick) I get this output:

filename.tif TIFF 7300x5536 7300x5536+0+0 1-bit Bilevel DirectClass 1.854MB 0.000u 0:00.000

I want to convert this to a png file (to display on the web), so I do convert filename.tif filename.png, however when I identify this file, I get:

1577.png PNG 7300x5536 7300x5536+0+0 8-bit PseudoClass 2c 1.669MB 0.000u 0:00.000

i.e. it reports as 8-bit image (right?)

How can I force this into a 2 bit image?

My goal is to reduce the filesize as much as possible (without losing quality), and i think that if it's 2 bits per pixel, it'll use less space.

Update: I have already tried the following options (on their own): -depth 2, -colors 2

Upvotes: 3

Views: 3832

Answers (1)

pconcepcion
pconcepcion

Reputation: 5641

Maybe you can try with:

convert -colors 2 filename.tif filename.png

From Imagemagic documentation ( http://www.imagemagick.org/script/command-line-options.php#colors )

Upvotes: 2

Related Questions