Hermann Hoch wrote:
> So all considerations to improve the LCS script are,
> TMHO, of rather theoretical value. Here are some more:
> The Atkinson algorithm uses multiples of 1/8 = 0.125 for
> the diffusion-error, the Floyd-Steinberg algorithm uses
> multiples of 1/16 = 0.0625.
> And have this in mind:
> Whenever you use numToChar(Number) in your script you
> are wrong by Number - round(Number) of the accumulated
> pixel value ...
This is correct, for this reason, in the most recent version of
this handler, I am using 2 chars to store the new pixel value.
first char is a whole number from 0 to 255 and the second
char represent a decimal part from 0 to 99.
I will test if using 5 chars for storing the new pixel value.
In this way, the new pixel could store values of
0000.000000 that should be enough for this task...
After reading Mark's answer, I learned that using a numerical
ordered array to store pixel values could be really fast too.
This is another path to explore.
For multiples of 1/8 (Atkinson) you need 8*256=2048 integers,
that is 11 Bit.
For multiples of 1/16 (Floyd-Steinberg) you need 16*256=4096
integers, that is 12 Bit.
In 2 chars = 16 Bit fit even multiples of 1/256.
No dither-algorithm uses such tiny diffusion-errors.