-posterize: near white colors replaced by green/brown

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
roelsch

-posterize: near white colors replaced by green/brown

Post by roelsch »

-posterize with more than 40 levels replaces near white colors with wrong colors.

$ convert -size 32x128 gradient: -posterize 32 test0.png
test0.png is correct. The bug doesn't affect posterizing to 32 levels.

$ convert -size 32x128 gradient: -posterize 64 test1.png
In test1.png the near white colors are replaced by green and brown tints.

$ convert -size 32x128 gradient:red-black -posterize 64 test2.png
test2.png is correct. This image doesn't contain light colors.

$ convert -size 32x128 gradient:white-red -posterize 64 test3.png
Again the near white colors turn green and brown.

$ convert magick:logo -posterize 64 test4.png
The white background on the logo and the beard turn brown, with green in the near-white regions.

$convert -version
Version: ImageMagick 6.6.6-7 2010-12-26 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: -posterize: near white colors replaced by green/brown

Post by magick »

We can reproduce the problem you posted and have a patch in ImageMagick 6.6.6-8 Beta available by sometime tomorrow. Thanks.
Post Reply