How to change from Class: DirectClass to PseudoClass-2c ??
Posted: 2008-10-12T19:55:06-07:00
When I make PNG images with imagemagick, they are bigger than the same images made with ms-paint(!!). The only difference is that imagemagick makes DirectClass-monochrome PNG images, while ms-paint makes Pseudoclass-2c PNG images with pallate. I've read through pages and pages of docs and can't figure out how to get imagemagick to use "Pseudoclass-2c" instead. Can anyone help?
~~~~ A short Demonstration follows directly below: ~~~~
---------------------------------------------
START WITH THE FOLLOWING 23kB PNG IMAGE:
---------------------------------------------
Create a 1000x1000 pixel image with ms-paint,
save it as a "monochrome bmp" to strip out
the color info, and then "save as" small.png
to make the example image we use below.
zero:~# identify -verbose small.png
small.png PNG 1000x1000 1000x1000+0+0 PseudoClass 2c 23kb
Image: small.png
Format: PNG (Portable Network Graphics)
Geometry: 1000x1000
Class: PseudoClass
Type: Bilevel
Endianess: Undefined
Colorspace: Gray
Channel depth:
Gray: 1-bits
Channel statistics:
Gray:
Min: 0 (0)
Max: 1 (1)
Mean: 0.793643 (0.793643)
Standard deviation: 0.40469 (0.40469)
Colors: 2
Histogram:
206357: ( 0, 0, 0) black
793643: (255,255,255) white
Rendering-intent: Undefined
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)
Tile geometry: 1000x1000+0+0
Resolution: 72x72
Units: Undefined
Filesize: 23kb
Interlace: None
Background Color: white
Border Color: #DFDFDF
Matte Color: grey74
Page geometry: 1000x1000+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Signature: eb05b659ee35b79b76566ef23e7a1d526bfd8009a313819ec6709293ee0c090d
Software: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org
Tainted: False
Version: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org
------------------------------------------------------------------------
NEXT STRIP OUT THE BITMAP AND RE-CREATE THE PNG VIA IMAGEMAGICK:
------------------------------------------------------------------------
zero:~#convert small.png temp.mono
zero:~#convert -size 1000x1000 temp.mono toobig.png
--------------------------------------------------------------
YOU END UP WITH THIS BIGGER PNG IMAGE AND WASTED SPACE:
--------------------------------------------------------------
zero:~# identify -verbose toobig.png
toobig.png PNG 1000x1000 1000x1000+0+0 PseudoClass 65536c 39kb
Image: toobig.png
Format: PNG (Portable Network Graphics)
Geometry: 1000x1000
Class: PseudoClass
Type: Grayscale
Endianess: Undefined
Colorspace: Gray
Channel depth:
Gray: 1-bits
Channel statistics:
Gray:
Min: 0 (0)
Max: 1 (1)
Mean: 0.793643 (0.793643)
Standard deviation: 0.40469 (0.40469)
Colors: 65536
Histogram:
206357: ( 0, 0, 0) black
793643: (65535,65535,65535) white
Rendering-intent: Undefined
Resolution: 72x72
Units: Undefined
Filesize: 39kb
Interlace: None
Background Color: white
Border Color: #DFDFDFDFDFDF
Matte Color: grey74
Page geometry: 1000x1000+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Signature: eb05b659ee35b79b76566ef23e7a1d526bfd8009a313819ec6709293ee0c090d
Tainted: False
Version: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org
---------------------------------------------------------------------
AND I CAN'T FIGURE OUT HOW TO KEEP THE IMAGE IN PSEUDOCLASS-2C
---------------------------------------------------------------------
If you have read this far, then I already owe a few beers =)
Thanks
~~~~ A short Demonstration follows directly below: ~~~~
---------------------------------------------
START WITH THE FOLLOWING 23kB PNG IMAGE:
---------------------------------------------
Create a 1000x1000 pixel image with ms-paint,
save it as a "monochrome bmp" to strip out
the color info, and then "save as" small.png
to make the example image we use below.
zero:~# identify -verbose small.png
small.png PNG 1000x1000 1000x1000+0+0 PseudoClass 2c 23kb
Image: small.png
Format: PNG (Portable Network Graphics)
Geometry: 1000x1000
Class: PseudoClass
Type: Bilevel
Endianess: Undefined
Colorspace: Gray
Channel depth:
Gray: 1-bits
Channel statistics:
Gray:
Min: 0 (0)
Max: 1 (1)
Mean: 0.793643 (0.793643)
Standard deviation: 0.40469 (0.40469)
Colors: 2
Histogram:
206357: ( 0, 0, 0) black
793643: (255,255,255) white
Rendering-intent: Undefined
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)
Tile geometry: 1000x1000+0+0
Resolution: 72x72
Units: Undefined
Filesize: 23kb
Interlace: None
Background Color: white
Border Color: #DFDFDF
Matte Color: grey74
Page geometry: 1000x1000+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Signature: eb05b659ee35b79b76566ef23e7a1d526bfd8009a313819ec6709293ee0c090d
Software: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org
Tainted: False
Version: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org
------------------------------------------------------------------------
NEXT STRIP OUT THE BITMAP AND RE-CREATE THE PNG VIA IMAGEMAGICK:
------------------------------------------------------------------------
zero:~#convert small.png temp.mono
zero:~#convert -size 1000x1000 temp.mono toobig.png
--------------------------------------------------------------
YOU END UP WITH THIS BIGGER PNG IMAGE AND WASTED SPACE:
--------------------------------------------------------------
zero:~# identify -verbose toobig.png
toobig.png PNG 1000x1000 1000x1000+0+0 PseudoClass 65536c 39kb
Image: toobig.png
Format: PNG (Portable Network Graphics)
Geometry: 1000x1000
Class: PseudoClass
Type: Grayscale
Endianess: Undefined
Colorspace: Gray
Channel depth:
Gray: 1-bits
Channel statistics:
Gray:
Min: 0 (0)
Max: 1 (1)
Mean: 0.793643 (0.793643)
Standard deviation: 0.40469 (0.40469)
Colors: 65536
Histogram:
206357: ( 0, 0, 0) black
793643: (65535,65535,65535) white
Rendering-intent: Undefined
Resolution: 72x72
Units: Undefined
Filesize: 39kb
Interlace: None
Background Color: white
Border Color: #DFDFDFDFDFDF
Matte Color: grey74
Page geometry: 1000x1000+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Signature: eb05b659ee35b79b76566ef23e7a1d526bfd8009a313819ec6709293ee0c090d
Tainted: False
Version: ImageMagick 6.2.4 02/10/07 Q16 http://www.imagemagick.org
---------------------------------------------------------------------
AND I CAN'T FIGURE OUT HOW TO KEEP THE IMAGE IN PSEUDOCLASS-2C
---------------------------------------------------------------------
If you have read this far, then I already owe a few beers =)
Thanks