Page 1 of 1

Large 1bit BMP with text, how ?

Posted: 2013-09-11T01:16:33-07:00
by myicq
I have a need to create a (large) 1bit BMP file with text inside.

The file must be identical in type to this one, created using PaintShop Pro:
https://dl.dropboxusercontent.com/u/224 ... e_test.zip

The image identifies as

Code: Select all

large_image.bmp BMP 3000x1200 3000x1200+0+0 1-bit sRGB 2c
I can create similar blank (white) image, but I have had no luck producing similar image with large text.

At the moment I have two issues:
  • pointsize in annotate seems to be ignored, I need to have a text with pointsize from 150 to 350
  • no matter what I have tried, the output is always 24 bit BMP, resulting in massive files
Can anyone produce a simple example what gives a 1-bit BMP, white background, black (large) text.

The final size of BMP should be 65000 x 1200 pixel, resulting in around 9753662 bytes.

Thankful for any assistance.

Code: Select all

Version: ImageMagick 6.8.6-8 2013-08-04 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC OpenMP
Delegates: bzlib djvu fftw fontconfig freetype jng jp2 jpeg lcms lzma openexr pango png ps tiff webp x xml zlib

Re: Large 1bit BMP with text, how ?

Posted: 2013-09-11T06:40:56-07:00
by snibgo
It seems that IM doesn't generally want to create bilevel BMP files. But it will do, if the input is a bilevel PNG.

Annotate works, as far as I know. "-gravity" is generally needed.

Code: Select all

convert -size 65000x1200 xc:White -pointsize 300 +antialias -fill Black -gravity Center -annotate 0x0 "Large File" -type bilevel x.png

convert x.png x.bmp

identify x.bmp
(Windows script. For Unix or Max, use single quotes instead of double quotes.)

Re: Large 1bit BMP with text, how ?

Posted: 2013-09-11T10:01:22-07:00
by fmw42
try writing out to BMP3:image.bmp or BMP2:image.bmp I am not sure BMP4 (the default) supports 1-bit. See http://www.imagemagick.org/Usage/formats/#bmp

Re: Large 1bit BMP with text, how ?

Posted: 2013-09-16T01:21:30-07:00
by myicq
snibgo wrote:It seems that IM doesn't generally want to create bilevel BMP files. But it will do, if the input is a bilevel PNG.
Thank you :) It's beyond my understanding why this is not working, since it's such a simple format and used everywhere in Windows + industrial machines world. Oh well.

I can achieve the goal, and that's the point. Now I just have to play around with annotate and draw.

Thanks for your help again.