Dear All,
If I run (on Windows 7 / ImageMagick 6.9.1-3 Q16 x86 portable)
"convert input.png -depth 1 -define png:color-type=3 output01.png" and
"convert input.png -depth 1 -negate -define png:color-type=3 output02.png"
I get two images that look the same (in my case input.png is already 1-bit / indexed); the Problem is neither there with color-type=2 nor with tif, but somehow with indexed png + 1-bit color-depth ...
identify -verbose input.png is:
Colors: 2
Histogram:
1144010: ( 0, 0, 0) #000000 gray(0)
12932969: (255,255,255) #FFFFFF gray(255)
Colormap entries: 2
Colormap:
0: (255,255,255) #FFFFFF gray(255)
1: ( 0, 0, 0) #000000 gray(0)
identify -verbose output01.png is:
Colors: 2
Histogram:
12932969: ( 0, 0, 0) #000000 gray(0)
1144010: (255,255,255) #FFFFFF gray(255)
Colormap entries: 2
Colormap:
0: (255,255,255) #FFFFFF gray(255)
1: ( 0, 0, 0) #000000 gray(0)
identify -verbose output02.png is:
Colors: 2
Histogram:
12932969: ( 0, 0, 0) #000000 gray(0)
1144010: (255,255,255) #FFFFFF gray(255)
Colormap entries: 2
Colormap:
0: ( 0, 0, 0) #000000 gray(0)
1: (255,255,255) #FFFFFF gray(255)
"mogrify -define png:color-type=3 output01.png" somehow it adds a color map entry / "identify -verbose output01.png (neu)" is:
Colors: 2
Histogram:
12932969: ( 0, 0, 0) #000000 gray(0)
1144010: (255,255,255) #FFFFFF gray(255)
Colormap entries: 3
Colormap:
0: ( 0, 0, 0) #000000 gray(0)
1: (255,255,255) #FFFFFF gray(255)
2: (254,254,254) #FEFEFE gray(254)
indexed 1-bit png is negated
Re: indexed 1-bit png is negated
The extra entry is for the background color. To prevent that, use
Verified that the conversion to type=3 is inverting black and white. I don't know why but will
investigate.
Code: Select all
mogrify -define png:color-type=3 -define png:exclude-chunk=bKGD output01.png
investigate.
Re: indexed 1-bit png is negated
it seems to me that it does not invert when the first pixel is black...
convert input.png -size 1x1 -fill black -draw "point 0,0" -depth 1 -define png:color-type=3 output.png
works perfectly without any negation
convert input.png -size 1x1 -fill black -draw "point 0,0" -depth 1 -define png:color-type=3 output.png
works perfectly without any negation
Re: indexed 1-bit png is negated
The bug was introduced in ImageMagick-6.8.7-9.