Page 2 of 2

Re: -type command not working

Posted: 2010-01-29T14:57:52-07:00
by magick
The PNG developer says:
  • I think we mentioned already that "identify" doesn't tell them anything about format that PNG uses. If they only have black pixels, "identify" will tell them it's bilevel no matter how they stored it:

    [studio Forum_bugs]$ cat try.sh
    echo 4.png
    pngcrush -n -v 4.png | grep type
    echo 5.png
    convert 4.png -define png:color-type=2 5.png
    pngcrush -n -v 5.png | grep type
    echo 6.png
    convert 5.png -type TrueColor 6.png
    pngcrush -n -v 6.png | grep type
    identify -verbose 6.png | grep "Type"
    [studio Forum_bugs]$ ./try.sh
    4.png
    Color type=2
    5.png
    Color type=2
    6.png
    Color type=2
    Type: Bilevel
If this does not resolve the issue, it will need to wait. The PNG developer is consumed with another project will not be available for several weeks.

Re: -type command not working

Posted: 2010-01-29T15:24:59-07:00
by gotskill10
I don't think this problem is specific to PNG, lets try a JPG example:

$ convert --version
Version: ImageMagick 6.5.9-1 2010-01-28 Q8 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
$ curl -O http://s3.amazonaws.com/mixbook/4.jpg
$ convert 4.jpg -type TrueColor 5.jpg
$ identify -verbose 5.jpg | grep "Type"
Type: Bilevel

So its not working with newest version of IM with both JPG and PNG. What am I doing wrong here?
magick wrote:The PNG developer says:
  • I think we mentioned already that "identify" doesn't tell them anything about format that PNG uses. If they only have black pixels, "identify" will tell them it's bilevel no matter how they stored it:

    [studio Forum_bugs]$ cat try.sh
    echo 4.png
    pngcrush -n -v 4.png | grep type
    echo 5.png
    convert 4.png -define png:color-type=2 5.png
    pngcrush -n -v 5.png | grep type
    echo 6.png
    convert 5.png -type TrueColor 6.png
    pngcrush -n -v 6.png | grep type
    identify -verbose 6.png | grep "Type"
    [studio Forum_bugs]$ ./try.sh
    4.png
    Color type=2
    5.png
    Color type=2
    6.png
    Color type=2
    Type: Bilevel
If this does not resolve the issue, it will need to wait. The PNG developer is consumed with another project will not be available for several weeks.

Re: -type command not working

Posted: 2010-01-29T17:01:12-07:00
by magick
The type returned by identify is the potential type of the image. Even if the image is truecolor, if the color depth is 1 and grayscale, ImageMagick returns BiLevel. This is a design decision. We add debugging to determine more detailed information about the image type. Add -debug coder to your command line when identifying your JPEG image.

Re: -type command not working

Posted: 2010-01-30T07:57:59-07:00
by glennrp
Don't look at the "Type" from identify to see what type of storage an image format used That only tells you the characteristics of the image after ImageMagick has decoded it. Try
  • identify -debug coder -log %e file.png
    pngcheck -v file.png
or
  • pngcrush -n -v file.png
instead.

Re: -type command not working

Posted: 2010-01-31T14:53:22-07:00
by adrianj
I have been dealing with the same issues and I updated to 6.5.9-1 and with:

convert -background transparent cmyk_spiderweb.svg -format png32 -depth 8 -type TruecolorMatte -define png:color-type=6 cmyk_spiderweb.png

identify -verbose -debug coder -log %e cmyk_spiderweb.png

shows: BiLevel, but

pngcheck -v cmyk_spiderweb.png

shows: 32-bit RGB+alpha