Set the colortable to use the cubicles algorithm to lookup
the closest color. This is a mostly very fast and very
accurate way to find the correct color, and the default
algorithm.
The colorspace is divided in small cubes, each cube
containing the colors in that cube. Each cube then gets
a list of the colors in the cube, and the closest from
the corners and midpoints between corners.
When a color is needed, the algorithm first finds the
correct cube and then compares with all the colors in
the list for that cube.
example: colors=Image.Colortable(img)->cubicles();
algorithm time: between O[m] and O[m * n],
where n is numbers of colors and m is number of pixels
The arguments can be heavy trimmed for the usage
of your colortable; a large number (10×10×10 or bigger)
of cubicles is recommended when you use the colortable
repeatedly, since the calculation takes much
more time than usage.
recommended values:
image size setup
100×100 cubicles(4,5,4) (default)
1000×1000 cubicles(12,12,12) (factor 2 faster than default)
In some cases, the full method is faster.
 |
 |
 |
original |
default cubicles, 16 colors |
accuracy=200 |