- 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
-type command not working
Re: -type command not working
The PNG developer says:
-
- Posts: 17
- Joined: 2007-06-02T14:01:34-07:00
Re: -type command not working
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?
$ 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:
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.
- 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
Re: -type command not working
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
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
- pngcrush -n -v file.png
Re: -type command not working
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
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