Hello,
I've noticed a quite annoying bug as it took me some time to know where it came from.
When you try to convert a png image with -type bilevel, it fails sometimes.
By fail I mean the result is a fully black image.
Note that on the version 6.6.9-7 it works normally.
Here's one image that fails for you to test.
-type bilevel fails on some PNG - IM 6.8.7-4
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: -type bilevel fails on some PNG - IM 6.8.7-4
I can duplicate the bug on IM 6.8.7.4 Q16 Mac OSX
convert 4d0y.png -type bilevel show:
convert 4d0y.png -type bilevel show:
Re: -type bilevel fails on some PNG - IM 6.8.7-4
I'm seeing the problem as well. Something's wrong when using -type bilevel to reduce the image to 2-colors,
without telling the PNG encoder how to do the reduction.
These work, with or without -type bilevel as the final option:
Also, the "-colorspace gray" can be omitted from the one using -threshold (but it is
required with the -ordered-dither).
without telling the PNG encoder how to do the reduction.
These work, with or without -type bilevel as the final option:
Code: Select all
convert 4d0y.png -colorspace gray -ordered-dither 2x2 4d0y-od2x2.png
convert 4d0y.png -colorspace gray -threshold 50% 4d0y-threshold50.png
required with the -ordered-dither).
Re: -type bilevel fails on some PNG - IM 6.8.7-4
Apparently 4d0y.png was originally a JPEG, converted by ImageMagick,
because it contains these text chunks, according to "pngcrush -n -v 4d0y.png":
but that didn't change the behavior.
because it contains these text chunks, according to "pngcrush -n -v 4d0y.png":
- Handling 4 tEXt/zTXt/iTXt chunks after IDAT
0 date:create: 2013-10-31T16:26:29+01:00
1 date:modify: 2013-10-31T16:26:29+01:00
2 jpeg:colorspace: 2
3 jpeg:sampling-factor: 2x2,1x1,1x1
but that didn't change the behavior.
Re: -type bilevel fails on some PNG - IM 6.8.7-4
converting to PPM results in the same full-color image.
converting to PPM with -type bilevel results in an all-black image.
It appears that the reduction to black happens somewhere other than
in coders/png.c.
The error does not occur with IM-6.8.7-3 so it's a new bug.
converting to PPM with -type bilevel results in an all-black image.
It appears that the reduction to black happens somewhere other than
in coders/png.c.
The error does not occur with IM-6.8.7-3 so it's a new bug.
Re: -type bilevel fails on some PNG - IM 6.8.7-4
We can reproduce the problem you posted and have a patch in ImageMagick 6.8.7-5 Beta available by sometime tomorrow. Thanks.
Re: -type bilevel fails on some PNG - IM 6.8.7-4
Svn revision 13682 (tomorrow's 6.8.7-5) works for me. Thanks.
Re: -type bilevel fails on some PNG - IM 6.8.7-4
Thanks for the fix guys !
It worked for all of my images !
Another question though : are you in charge of imagemagick-common libmagickcore5 and libmagickwand5 ?
Because I'm actually using wand as an api for python and it's still the same problem over here.
Do you have to update the libraries or they do not belong to you ?
It worked for all of my images !
Another question though : are you in charge of imagemagick-common libmagickcore5 and libmagickwand5 ?
Because I'm actually using wand as an api for python and it's still the same problem over here.
Do you have to update the libraries or they do not belong to you ?