I need to create a 1bpp BMP image, plain and simple.
My source for test is a PNG as exported by InkScape.
I think I tried every single combination of -type bilevel, -depth 2 etc etc - but always I get returned a 24 bpp image.
I have put sample files here: http://ge.tt/5Ob8ZOK/v/0
What I need is to go from drawing.png to drawing.bmp, but have the result be like drawing2.bmp
A diff with identify:
drawing.txt: Depth:8/1-bit 0..255 color 2.348 MB
drawing2.txt Depth: 1-bit 0..1 color 98 KB
it works if I do an additional
convert -threshold 2 drawing.bmp drawing2.bmp
but it's an extra step.
I use WinXP ImageMagick 6.7.6-5 Q16
Feel free to use my sample files to test.
Thanks !
[solved] from PNG til 1bpp BMP in one step ?
[solved] from PNG til 1bpp BMP in one step ?
Last edited by myicq on 2012-07-13T00:28:26-07:00, edited 1 time in total.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: from PNG til 1bpp BMP in one step ?
You need to look more closely at the verbose info. Your file has an alpha channel. Turn it off.
convert drawing.png -alpha off drawing.bmp
If that does not work, then try using BMP3:drawing.bmp or BMP2:drawing.bmp
convert drawing.png -alpha off -depth 1 -type bilevel BMP3:drawing.bmp
But I get the same result as the first.
As far as I know the result will always be palette, 8/1 bit. I do not know if IM supports a bilevel BMP.
however, see
http://www.imagemagick.org/Usage/formats/#bmp and the part about using ppm and pnmdepth
convert drawing.png -alpha off drawing.bmp
If that does not work, then try using BMP3:drawing.bmp or BMP2:drawing.bmp
convert drawing.png -alpha off -depth 1 -type bilevel BMP3:drawing.bmp
But I get the same result as the first.
As far as I know the result will always be palette, 8/1 bit. I do not know if IM supports a bilevel BMP.
however, see
http://www.imagemagick.org/Usage/formats/#bmp and the part about using ppm and pnmdepth
[solved] Re: from PNG til 1bpp BMP in one step ?
Code: Select all
c:\im\convert drawing.png -type bilevel -colors 256 drawing.bmp
Thanks for all help
