Convert PNG to BMP with depth of 1

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?".
Locked
beneficii
Posts: 1
Joined: 2018-03-10T19:11:36-07:00
Authentication code: 1152

Convert PNG to BMP with depth of 1

Post by beneficii »

I'm trying to convert PNG files to BMP files using ImageMagick, and to make the BMP files have a depth of 1.

I try the following command:
magick in.png out.bmp -depth 1
But it comes back with:
magick: unable to open image 'out.bmp': No such file or directory @ error/blob.c/OpenBlob/3357
What can I do here? I find the command line options guide to be very complex, while my requirements are very simple, so I'm not sure what steps to take from here.

User avatar
fmw42
Posts: 26383
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Convert PNG to BMP with depth of 1

Post by fmw42 »

What do you mean by depth 1? Depth 1 for each channel or depth one for the whole image (i.e. black and white). Your syntax is wrong. You must read the input before and settings or operators.

Code: Select all

convert in.png -depth 1 out.bmp
will make each channel black and white.

If you want the output to be black and white, the use

Code: Select all

convert in.png -monochrome out.bmp
or

Code: Select all

convert in.png -threshold 50% out.bmp
or

Code: Select all

convert in.png -colorspace gray -depth 1 out.bmp
or

Code: Select all

convert in.png -colorspace gray -type bilevel out.bmp

Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620

For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
http://imagemagick.org/script/porting.php#cli

Locked