Page 1 of 1

How to change from Class: DirectClass to PseudoClass-2c ??

Posted: 2008-10-12T19:55:06-07:00
by snovotill
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

Re: How to change from Class: DirectClass to PseudoClass-2c ??

Posted: 2008-10-12T20:55:18-07:00
by fmw42
try adding -type palette to your command line to result in Class=Pseudocolor

see

convert -list type

for all the options.

Re: How to change from Class: DirectClass to PseudoClass-2c ??

Posted: 2008-10-13T17:02:28-07:00
by snovotill
It works great, thanks. (It also triggers a bug in my version of imagemagick above.)

P.S. funny thing: When I type "convert -list type" then it lists a bunch of fonts LOL!

Re: How to change from Class: DirectClass to PseudoClass-2c ??

Posted: 2008-10-13T19:26:42-07:00
by fmw42
snovotill wrote:It works great, thanks. (It also triggers a bug in my version of imagemagick above.)

P.S. funny thing: When I type "convert -list type" then it lists a bunch of fonts LOL!

That was changed a long time ago. Now to get the list of fonts you use:

convert -list font


Time for you to upgrade!!!!!

IM is now at 6.4.4

What version are you using?

identify -version

Re: How to change from Class: DirectClass to PseudoClass-2c ??

Posted: 2008-10-18T10:18:22-07:00
by snovotill
I just use what comes with Debian. But now it's up to 6.3.7.9.dfsg1-2+b2_i386.deb which is working much better for me than the older 6.2 version.

Re: How to change from Class: DirectClass to PseudoClass-2c ??

Posted: 2008-10-18T10:30:31-07:00
by fmw42
snovotill wrote:I just use what comes with Debian. But now it's up to 6.3.7.9.dfsg1-2+b2_i386.deb which is working much better for me than the older 6.2 version.

Too bad they are still using such an old version. That is about 70 minor version changes behind.

Re: How to change from Class: DirectClass to PseudoClass-2c ??

Posted: 2008-10-18T13:34:25-07:00
by snovotill
On one hand, it's wonderful that someone has stepped up to the plate to be Debian Package Maintainer for imagemagick, and on the other hand it's weird that this person isn't a fanatic user of the package. For if he was, then surely the package would be more up to date.

This exact scenario a funny thing about Debian, and it's actually quite prevalent. It used to be a big problem for me, but now that many softwares, in general, have matured to a point where older versions are usable, it's becoming less of an issue. Especially because Debian Security seems to take their job seriously as far as getting security fixes out quickly, regardless of the age of the package. (Hey, if you're running old stuff (like Windows For Workgroups lol) in today's environment, then perhaps you are secure and virusproof too)