Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
yoya
Posts: 4 Joined: 2013-07-11T21:55:26-07:00
Authentication code: 6789
Location: Japan
Post
by yoya » 2013-07-11T23:31:41-07:00
quantize_error summarization has been changed at 6.4.1-3
* magick/quantize.c
- 6.4.1-2
Code: Select all
node_info->quantize_error+=sqrt((double) (error.red*error.red+
error.green*error.green+error.blue*error.blue+error.opacity*
error.opacity));
- 6.4.1-3
Code: Select all
if (IsColorSimilar(image,p,p+count) == MagickFalse)
break;
(omit...)
node_info->quantize_error+=sqrt((double) (count*error.red*error.red+
count*error.green*error.green+count*error.blue*error.blue+
count*error.opacity*error.opacity));
This change causes a color quality degradation of quantized images.
- correct code, I think.
Code: Select all
if (IsColorSimilar(image,p,p+count) == MagickFalse)
break;
(omit...)
node_info->quantize_error+=count*sqrt((double) (error.red*error.red+
error.green*error.green+error.blue*error.blue+
error.opacity*error.opacity));
ref) my patch at 6.x
-
https://github.com/gree/YoyaMagick/comm ... e1bf7ac540
magick
Site Admin
Posts: 11064 Joined: 2003-05-31T11:32:55-07:00
Post
by magick » 2013-07-12T03:59:30-07:00
We can reproduce the problem you posted and added your patch to ImageMagick 6.8.6-5 Beta available by sometime tomorrow. Thanks.
yoya
Posts: 4 Joined: 2013-07-11T21:55:26-07:00
Authentication code: 6789
Location: Japan
Post
by yoya » 2013-07-13T11:40:39-07:00
Thank you for your quick response.
At 6.8.6-5, this modified code has wrong calculation.
Code: Select all
node_info->quantize_error+=count*sqrt((double) (error.red*error.red+
count*error.green*error.green+count*error.blue*error.blue+
count*error.opacity*error.opacity));
In sqrt all count multiplication must be removed.
Code: Select all
node_info->quantize_error+=count*sqrt((double) (error.red*error.red+
error.green*error.green+error.blue*error.blue+
error.opacity*error.opacity));
magick
Site Admin
Posts: 11064 Joined: 2003-05-31T11:32:55-07:00
Post
by magick » 2013-07-13T12:24:02-07:00
We can reproduce the problem you posted and added your patch to ImageMagick 6.8.6-6 Beta available by sometime tomorrow. Thanks.