diff --git a/ChangeLog b/ChangeLog index 33aca81302..5d2cff9a5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-05-06 6.9.12-12 + * Release ImageMagick version 6.9.12-11 GIT revision 16... + +2021-05-06 6.9.12-12 + * -layers optimize no longer produces broken output (reference + https://github.com/ImageMagick/ImageMagick/issues/3520). + 2021-05-04 6.9.12-11 * Release ImageMagick version 6.9.12-11 GIT revision 16625:7d8a3b762:20210504 @@ -23,8 +30,6 @@ 2021-04-09 6.9.12-8 * constrain sub-image list. - * -layers optimize no longer produces broken output (reference - https://github.com/ImageMagick/ImageMagick/issues/3520). * write tiff colormapped images with an alpha channel as PHOTOMETRIC_RGB 2021-04-03 6.9.12-6 diff --git a/magick/quantize.c b/magick/quantize.c index 1f2957f5e7..ce409353aa 100644 --- a/magick/quantize.c +++ b/magick/quantize.c @@ -1784,11 +1784,11 @@ static MagickBooleanType RiemersmaDither(Image *image,CacheView *image_view, AssociateAlphaPixel(cube_info,q,&pixel); for (i=0; i < ErrorQueueLength; i++) { - pixel.red+=p->weights[i]*p->error[i].red; - pixel.green+=p->weights[i]*p->error[i].green; - pixel.blue+=p->weights[i]*p->error[i].blue; + pixel.red+=p->weights[i]*p->error[i].red/16; + pixel.green+=p->weights[i]*p->error[i].green/16; + pixel.blue+=p->weights[i]*p->error[i].blue/16; if (cube_info->associate_alpha != MagickFalse) - pixel.opacity+=p->weights[i]*p->error[i].opacity; + pixel.opacity+=p->weights[i]*p->error[i].opacity/16; } pixel.red=(MagickRealType) ClampPixel(pixel.red); pixel.green=(MagickRealType) ClampPixel(pixel.green); @@ -1993,7 +1993,7 @@ static CubeInfo *GetCubeInfo(const QuantizeInfo *quantize_info, for (i=0; i < ErrorQueueLength; i++) { cube_info->weights[ErrorQueueLength-i-1]=PerceptibleReciprocal(weight); - weight*=exp(log(((double) QuantumRange+1.0))/(ErrorQueueLength-1.0)); + weight*=exp(log(16)/(ErrorQueueLength-1.0)); } /* Normalize the weighting factors.