Page 1 of 1

Can't write real Bilevel png or bmp images

Posted: 2011-05-02T11:24:54-07:00
by mhoehn@hotmail.de
I can't write real Bilevel png or bmp images.
They always appear as RGB images using identify -verbose.
Is this a limitation of those image formats or am I doing something wrong?
Here is one convert example:
convert -density 600 test.tif -profile AdobeRGB1998.icc -strip -type TrueColor -background white -resize 367x367 -colorspace Gray -ordered-dither checks -define png:bit-depth=1 test.png

Even a "convert test.png -type Bilevel test.bmp" after above example writes an RGB image .

How can I really create Bilevel formats and not RGB simulated ones?

Re: Can't write real Bilevel png or bmp images

Posted: 2011-05-02T14:41:49-07:00
by fmw42
Have you tried -type bilevel or use -monochrome?

This works for me on IM 6.6.9.7 Q16 Mac OSX Tiger for both png and bmp.

convert logo: -type bilevel logo_tmp1.png
freds-mac-mini:~ fred$ idv logo_tmp1.png
Image: logo_tmp1.png
Format: PNG (Portable Network Graphics)
Class: PseudoClass
Geometry: 640x480+0+0
Resolution: 72x72
Print size: 8.88889x6.66667
Units: Undefined
Type: Bilevel
Base type: Bilevel
Endianess: Undefined
Colorspace: Gray
Depth: 8/1-bit
Channel depth:
gray: 1-bit
Channel statistics:
Gray:
min: 0 (0)
max: 255 (1)
mean: 222.145 (0.871156)
standard deviation: 85.432 (0.335028)
kurtosis: 2.9092
skewness: -2.21567
Histogram:
39581: ( 0, 0, 0) #000000 black
267619: (255,255,255) #FFFFFF white
Colormap: 2
0: ( 0, 0, 0) #000000 black
1: (255,255,255) #FFFFFF white



Note that PNG has been under development for some time and you may have a version with bugs. You don't say what version and platform you are using?

Please read viewtopic.php?f=1&t=9620