Page 1 of 1

Convert PNG to BMP with depth of 1

Posted: 2018-03-10T19:17:19-07:00
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.

Re: Convert PNG to BMP with depth of 1

Posted: 2018-03-10T20:07:56-07:00
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