Possible bug trying to annotate 1bit BMP

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
nerdx86
Posts: 4
Joined: 2012-05-01T08:28:52-07:00
Authentication code: 13

Possible bug trying to annotate 1bit BMP

Post by nerdx86 »

I am trying to annotate a 1bit BMP (no alpha channel) with non-antialiased text (this is for a low res 1 bit black and white print engine), what I keep getting is a file that either stores 24 or 32 bits per pixel.. I have tried everything I can think of, plus a few.. I have gotten some options to work, but then I swear I ran them again and they didn't work.. (could be exhaustion.. :)

After I wrote the bulk of this, I stumbled onto -type bilevel which save it out, but windows then reads it as some funky green and red colormap.. I think this might be version specific, because hello 2 looked normal in all viewers before I updated to the newest release.. (I had an older verion that was from last oct)

I don't know if this is an issue with aliased drawing, alpha removal, or BMP saving.. So I really don't know where to go from here..

These are a distilled summary of what I have tried: (4x6.bmp is a 1 bit bitmap)

Code: Select all

identify -verbose 4x6.bmp
identify -verbose test.bmp
convert  -verbose 4x6.bmp +antialias -depth 1 -colors 2 -mattecolor black -bordercolor white -border 0 -stretch Expanded -annotate 270x270+50+250 hello_world -monochrome -identify hello1.bmp
convert  -verbose 4x6.bmp -depth 1 -colors 2 -stretch Expanded -annotate 270x270+50+250 hello_world -monochrome -identify hello2.bmp
convert  -verbose 4x6.bmp -set colorspace rgb +antialias -depth 1 -colors 2 -stretch Expanded -annotate 270x270+50+250 hello_world -monochrome -identify hello3.bmp
convert  -verbose 4x6.bmp -set colorspace rgb +antialias +matte -stretch Expanded -annotate 270x270+50+250 hello_world -monochrome -identify hello4.bmp
convert  -verbose 4x6.bmp -set colorspace rgb +antialias +matte -annotate 270x270+50+250 hello_world -monochrome -identify hello5.bmp
convert  -verbose 4x6.bmp  +antialias -annotate 270x270+50+250 hello_world -monochrome -identify hello6.bmp
convert  -verbose 4x6.bmp  +antialias -annotate 270x270+50+250 hello_world  -alpha remove -identify hello7.bmp
convert  -verbose 4x6.bmp  -set colorspace gray +antialias -annotate 270x270+50+250 hello_world -monochrome -alpha remove -identify hello7.bmp
convert  -verbose 4x6.bmp +antialias -annotate 270x270+50+250 hello_world -type palette -remap test.bmp -identify hello8.bmp
convert  -verbose 4x6.bmp -set colorspace gray +antialias -annotate 270x270+50+250 hello_world -remap test.bmp -type bilevel -identify hello9.bmp
convert  -verbose 4x6.bmp -set colorspace gray +antialias -stretch Expanded -pointsize 16 -annotate 270x270+50+250 @ArabicLabelRev.txt -remap test.bmp -type bilevel -identify hello.bmp



C:\PMSI_Technology\Programs\Atlas\ImageMagick>identify -verbose 4x6.bmp 
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: PseudoClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 1 (1)
      max: 1 (1)
      mean: 1 (1)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
  Colors: 1
  Histogram:
     76800: (255,255,255) #FFFFFF white
  Colormap: 2
         0: (  0,  0,  0) #000000 black
         1: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: 7ce2b125d99db9c2fb0b15a977979c8ab5664f2a8023548c01910bf7f50d04f9
  Artifacts:
    filename: 4x6.bmp
    verbose: true
  Tainted: False
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 4.8MB
  User time: 0.016u
  Elapsed time: 0:01.016
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org

C:\PMSI_Technology\Programs\Atlas\ImageMagick>identify -verbose test.bmp 
Image: test.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: PseudoClass
  Geometry: 72x72+0+0
  Resolution: 37.8x37.8
  Print size: 1.90476x1.90476
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.786844 (0.786844)
      standard deviation: 0.409537 (0.409537)
      kurtosis: -0.0376976
      skewness: -1.40082
  Colors: 2
  Histogram:
      1105: (  0,  0,  0) #000000 black
      4079: (255,255,255) #FFFFFF white
  Colormap: 2
         0: (  0,  0,  0) #000000 black
         1: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 72x72+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2011-10-28T11:36:04-04:00
    date:modify: 2005-08-30T16:23:58-04:00
    signature: cc25a78a89c4f1476641a5cde0e3b79b45e91ad340b47c53c56da9b753869f90
  Artifacts:
    filename: test.bmp
    verbose: true
  Tainted: False
  Filesize: 926B
  Number pixels: 5.18K
  Pixels per second: 51.84TB
  User time: 0.000u
  Elapsed time: 0:01.000
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp +antialias -depth 1 -colors 2 -mattecolor black -bordercolor white -border 0 -stretch Expanded -annotate 270x270+50+250 hello_world -monochrome -identify hello1.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.000u 0:00.000
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: DirectClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: Gray
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.997995 (0.997995)
      standard deviation: 0.0447346 (0.0447346)
      kurtosis: 493.703
      skewness: -22.2644
  Colors: 2
  Histogram:
       154: (  0,  0,  0) #000000 black
     76646: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: white
  Matte color: black
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: b2f40898ad03bc2632c258138fcbb47080212310a3b688f9ee708f6310f394aa
  Artifacts:
    bordercolor: white
    filename: 4x6.bmp
    mattecolor: black
    verbose: true
  Tainted: True
  Filesize: 0B
  Number pixels: 76.8K
  Pixels per second: 4.8MB
  User time: 0.031u
  Elapsed time: 0:01.016
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello1.bmp BMP 256x300 256x300+0+0 1-bit Bilevel DirectClass 229KB 0.313u 0:00.156

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp -depth 1 -colors 2 -stretch Expanded -annotate 270x270+50+250 hello_world -monochrome -identify hello2.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.000u 0:00.000
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: PseudoClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.997799 (0.997799)
      standard deviation: 0.0468581 (0.0468581)
      kurtosis: 449.44
      skewness: -21.2471
  Colors: 2
  Histogram:
       169: (  0,  0,  0) #000000 black
     76631: (255,255,255) #FFFFFF white
  Colormap: 2
         0: (255,255,255) #FFFFFF white
         1: (  0,  0,  0) #000000 black
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: ec44b5b97d2796d0f7a230a355798db836ae6d925760a733bf4e1ba359460618
  Artifacts:
    filename: 4x6.bmp
    verbose: true
  Tainted: True
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 705KB
  User time: 0.219u
  Elapsed time: 0:01.109
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello2.bmp BMP 256x300 256x300+0+0 1-bit Bilevel PseudoClass 2c 0.156u 0:00.077

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp -set colorspace rgb +antialias -depth 1 -colors 2 -stretch Expanded -annotate 270x270+50+250 hello_world -monochrome -identify hello3.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.000u 0:00.000
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: DirectClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: Gray
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.997995 (0.997995)
      standard deviation: 0.0447346 (0.0447346)
      kurtosis: 493.703
      skewness: -22.2644
  Colors: 2
  Histogram:
       154: (  0,  0,  0) #000000 black
     76646: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: gray(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: b2f40898ad03bc2632c258138fcbb47080212310a3b688f9ee708f6310f394aa
  Artifacts:
    filename: 4x6.bmp
    verbose: true
  Tainted: True
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 1.634MB
  User time: 0.094u
  Elapsed time: 0:01.047
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello3.bmp BMP 256x300 256x300+0+0 1-bit Bilevel DirectClass 229KB 0.313u 0:00.155

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp -set colorspace rgb +antialias +matte -stretch Expanded -annotate 270x270+50+250 hello_world -monochrome -identify hello4.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.031u 0:00.016
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: DirectClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: Gray
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.997995 (0.997995)
      standard deviation: 0.0447346 (0.0447346)
      kurtosis: 493.703
      skewness: -22.2644
  Colors: 2
  Histogram:
       154: (  0,  0,  0) #000000 black
     76646: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: gray(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: b2f40898ad03bc2632c258138fcbb47080212310a3b688f9ee708f6310f394aa
  Artifacts:
    filename: 4x6.bmp
    matte: false
    verbose: true
  Tainted: True
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 2.477MB
  User time: 0.063u
  Elapsed time: 0:01.031
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello4.bmp BMP 256x300 256x300+0+0 1-bit Bilevel DirectClass 229KB 0.313u 0:00.156

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp -set colorspace rgb +antialias +matte -annotate 270x270+50+250 hello_world -monochrome -identify hello5.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.000u 0:00.000
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: DirectClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: Gray
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.997995 (0.997995)
      standard deviation: 0.0447346 (0.0447346)
      kurtosis: 493.703
      skewness: -22.2644
  Colors: 2
  Histogram:
       154: (  0,  0,  0) #000000 black
     76646: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: gray(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: b2f40898ad03bc2632c258138fcbb47080212310a3b688f9ee708f6310f394aa
  Artifacts:
    filename: 4x6.bmp
    matte: false
    verbose: true
  Tainted: True
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 2.478MB
  User time: 0.063u
  Elapsed time: 0:01.030
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello5.bmp BMP 256x300 256x300+0+0 1-bit Bilevel DirectClass 229KB 0.313u 0:00.157

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp  +antialias -annotate 270x270+50+250 hello_world -monochrome -identify hello6.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.000u 0:00.000
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: DirectClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.997995 (0.997995)
      standard deviation: 0.0447346 (0.0447346)
      kurtosis: 493.703
      skewness: -22.2644
  Colors: 2
  Histogram:
       154: (  0,  0,  0) #000000 black
     76646: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: b2f40898ad03bc2632c258138fcbb47080212310a3b688f9ee708f6310f394aa
  Artifacts:
    filename: 4x6.bmp
    verbose: true
  Tainted: True
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 4.8MB
  User time: 0.031u
  Elapsed time: 0:01.016
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello6.bmp BMP 256x300 256x300+0+0 1-bit Bilevel DirectClass 229KB 0.313u 0:00.156

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp  +antialias -annotate 270x270+50+250 hello_world  -alpha remove -identify hello7.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.000u 0:00.000
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: DirectClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
    alpha: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.997995 (0.997995)
      standard deviation: 0.0447346 (0.0447346)
      kurtosis: 493.703
      skewness: -22.2644
    Alpha:
      min: 1 (1)
      max: 1 (1)
      mean: 1 (1)
      standard deviation: 0 (0)
      kurtosis: 0
      skewness: 0
  Colors: 2
  Histogram:
       154: (  0,  0,  0,255) #000000 black
     76646: (255,255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: srgba(223,223,223,1)
  Matte color: grey74
  Transparent color: none
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: 2d8290a1d83958467e2140c8bfb88479d2cdbb35aa014ffc7f99aa162d85c80e
  Artifacts:
    filename: 4x6.bmp
    verbose: true
  Tainted: True
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 5.12MB
  User time: 0.031u
  Elapsed time: 0:01.014
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello7.bmp BMP 256x300 256x300+0+0 1-bit Bilevel DirectClass 295KB 0.344u 0:00.172

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp  -set colorspace gray +antialias -annotate 270x270+50+250 hello_world -monochrome -alpha remove -identify hello7.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.000u 0:00.000
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: DirectClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: Gray
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.997995 (0.997995)
      standard deviation: 0.0447346 (0.0447346)
      kurtosis: 493.703
      skewness: -22.2644
  Colors: 2
  Histogram:
       154: (  0,  0,  0) #000000 black
     76646: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: gray(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: b2f40898ad03bc2632c258138fcbb47080212310a3b688f9ee708f6310f394aa
  Artifacts:
    filename: 4x6.bmp
    verbose: true
  Tainted: True
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 5.12MB
  User time: 0.031u
  Elapsed time: 0:01.014
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello7.bmp BMP 256x300 256x300+0+0 1-bit Bilevel DirectClass 229KB 0.313u 0:00.156

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp +antialias -annotate 270x270+50+250 hello_world -type palette -remap test.bmp -identify hello8.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.000u 0:00.000
test.bmp BMP 72x72 72x72+0+0 1-bit PseudoClass 2c 926B 0.000u 0:00.000
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: PseudoClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: sRGB
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.997995 (0.997995)
      standard deviation: 0.0447346 (0.0447346)
      kurtosis: 493.703
      skewness: -22.2644
  Colors: 2
  Histogram:
       154: (  0,  0,  0) #000000 black
     76646: (255,255,255) #FFFFFF white
  Colormap: 2
         0: (  0,  0,  0) #000000 black
         1: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: srgb(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: b2f40898ad03bc2632c258138fcbb47080212310a3b688f9ee708f6310f394aa
  Artifacts:
    filename: 4x6.bmp
    type: palette
    verbose: true
  Registry:
    cache:test.bmp: test.bmp
  Tainted: True
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 409KB
  User time: 0.375u
  Elapsed time: 0:01.188
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello8.bmp BMP 256x300 256x300+0+0 1-bit Palette PseudoClass 2c 0.156u 0:00.077

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp -set colorspace gray +antialias -annotate 270x270+50+250 hello_world -remap test.bmp -type bilevel -identify hello9.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.000u 0:00.000
test.bmp BMP 72x72 72x72+0+0 1-bit PseudoClass 2c 926B 0.000u 0:00.000
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: PseudoClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: Gray
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.997995 (0.997995)
      standard deviation: 0.0447346 (0.0447346)
      kurtosis: 493.703
      skewness: -22.2644
  Colors: 2
  Histogram:
       154: (  0,  0,  0) #000000 black
     76646: (255,255,255) #FFFFFF white
  Colormap: 2
         0: (  0,  0,  0) #000000 black
         1: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: gray(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: b2f40898ad03bc2632c258138fcbb47080212310a3b688f9ee708f6310f394aa
  Artifacts:
    filename: 4x6.bmp
    type: bilevel
    verbose: true
  Registry:
    cache:test.bmp: test.bmp
  Tainted: True
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 614KB
  User time: 0.250u
  Elapsed time: 0:01.125
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello9.bmp BMP 256x300 256x300+0+0 1-bit Bilevel PseudoClass 2c 0.125u 0:00.062

C:\PMSI_Technology\Programs\Atlas\ImageMagick>convert  -verbose 4x6.bmp -set colorspace gray +antialias -stretch Expanded -pointsize 16 -annotate 270x270+50+250 @ArabicLabelRev.txt -remap test.bmp -type bilevel -identify hello.bmp 
4x6.bmp BMP 256x300 256x300+0+0 1-bit PseudoClass 2c 9.66KB 0.000u 0:00.000
test.bmp BMP 72x72 72x72+0+0 1-bit PseudoClass 2c 926B 0.000u 0:00.000
Image: 4x6.bmp
  Format: BMP (Microsoft Windows bitmap image)
  Class: PseudoClass
  Geometry: 256x300+0+0
  Resolution: 75.98x75.98
  Print size: 3.36931x3.94841
  Units: PixelsPerCentimeter
  Type: Bilevel
  Base type: Bilevel
  Endianess: Undefined
  Colorspace: Gray
  Depth: 1-bit
  Channel depth:
    gray: 1-bit
  Channel statistics:
    Gray:
      min: 0 (0)
      max: 1 (1)
      mean: 0.99556 (0.99556)
      standard deviation: 0.066486 (0.066486)
      kurtosis: 220.224
      skewness: -14.9072
  Colors: 2
  Histogram:
       341: (  0,  0,  0) #000000 black
     76459: (255,255,255) #FFFFFF white
  Colormap: 2
         0: (  0,  0,  0) #000000 black
         1: (255,255,255) #FFFFFF white
  Rendering intent: Perceptual
  Gamma: 0.45455
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Interlace: None
  Background color: white
  Border color: gray(223,223,223)
  Matte color: grey74
  Transparent color: black
  Compose: Over
  Page geometry: 256x300+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Undefined
  Orientation: Undefined
  Properties:
    date:create: 2012-05-02T13:30:20-04:00
    date:modify: 2012-05-02T15:52:43-04:00
    signature: a7fc6a3e518409d25c4de7f25fd3dc99114dfeb4b457c6544c78d17844bcfc76
  Artifacts:
    filename: 4x6.bmp
    type: bilevel
    verbose: true
  Registry:
    cache:test.bmp: test.bmp
  Tainted: True
  Filesize: 9.66KB
  Number pixels: 76.8K
  Pixels per second: 549KB
  User time: 0.266u
  Elapsed time: 0:01.139
  Version: ImageMagick 6.7.6-8 2012-04-22 Q16 http://www.imagemagick.org
4x6.bmp=>hello.bmp BMP 256x300 256x300+0+0 1-bit Bilevel PseudoClass 2c 0.125u 0:00.06
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Possible bug trying to annotate 1bit BMP

Post by fmw42 »

Have you tried saving as BMP3: or BMP2: (older formats that support 1 bit) I don't think the current BMP in IM supports 1bit. see
http://www.imagemagick.org/Usage/formats/#bmp
nerdx86
Posts: 4
Joined: 2012-05-01T08:28:52-07:00
Authentication code: 13

Drawing text on low resolution 1bit BMP

Post by nerdx86 »

Thanks!

(could an admin move this to an faq or general discussion area?)

That did it... Between an update, the +antialias, -type bilevel, -remap, and the bmp2:xxx.bmp I can produce bmp files of text for a foxjet duo printhead.. I'm going to post a couple command line in this thread, in case others are ever looking for it..


Foxjet Marksman Duo Fonts

(test.bmp must have the black and white in the correct positions within the palette, otherwise the image will be inverse to what you see on screen)

convert 4x6.bmp +antialias -annotate 270x270+50+250 hello_world -remap test.bmp -type bilevel BMP2:hello10.bmp

Obviously, one could also rotate the image 90 degrees, draw text and markups horizontally, and rotate 270 degrees.. But the key is to work at destination resolution 64dpi vertical (horizontal in the image) and 150 to 300 dpi horizontal, don't antialias the text, work in 1 bit resolution, save as BMP2, and remap the palette to match what FJ expects...

I did all this to be able to dynamically print Arabic for export, but it obviously applies to any text/graphics the the printhead cannot internally render..
Post Reply