png to black and white 1 bit bmp

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

png to black and white 1 bit bmp

Post by nirious »


I am new to this program.
I am trying to convert a black and white 24 bit png file to a black and white (1 bit) monocolor bmp file. So no grayscale.
Further I am only intersted in the top left part of the png file.
I must be doing something wrong because it creates the image (size and dpi are OK), but it is 256 indexed color (8bit). :?

Here is what I have:

Code: Select all

convert "c:\input.png" -crop 470x470+0+0 +repage -monochrome -depth 1 -type Bilevel "c:\output.bmp"
User avatar
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: png to black and white 1 bit bmp

Post by fmw42 »

Not sure this does any better (still type grayscale), but try

convert image.png -colors 2 +dither -type bilevel image.bmp

see also
Post Reply