* ImageMagick-6.8.6-4/magick/quantize.c
Code: Select all
/*
Identify the deepest node containing the pixel's color.
*/
node_info=p->root;
for (index=MaxTreeDepth-1; (ssize_t) index > 0; index--)
{
id=ColorToNodeId(cube_info,&pixel,index);
if (node_info->child[id] == (NodeInfo *) NULL)
break;
node_info=node_info->child[id];
}
node_info=node_info->parent;
/*
Find closest color among siblings and their children.
*/
p->target=pixel;
p->distance=(MagickRealType) (4.0*(QuantumRange+1.0)*((MagickRealType)
QuantumRange+1.0)+1.0);
ClosestColor(image,p,node_info->parent);
p->cache[i]=(ssize_t) p->color_number;
It's 2 times walking through parent until ClosestColor, so not siblings but uncle node.
I think L1805 code must be removed.
Code: Select all
node_info=node_info->parent;
ref) my patch at 6.x
- https://github.com/gree/YoyaMagick/comm ... 93af982b4d