Atkinson dither algorithm

Alejandro Tejada capellan2000 at
Sat Oct 7 10:54:34 EDT 2017

Hi Malte,

Malte Brill wrote:
> I already posted on the forums, but for completeness also here:
> a lot can be done by replacing repeat with with repeat for each where you
> --    repeat with i = 1 to the number of words of fldhexa3
> --    put 00 & word i of fldhexa3 & word i of fldhexa3 & word i of
fldhexa3 after tVar2
> --    end repeat
> repeat for each word theWord in fldhexa3
>  put 00 & theword & theword & theword after tVar2
> end repeat

This change reduced the time in a 25%!
Wonderful. Thanks a lot Malte :-D

> I always use strict compile mode, therefore I added the needed variable
> declarations and noticed you use startTime as a variablename, which is a
> reserved keyword. That is not a good idea.  (I noticed, because I managed
> freeze liveCode where I fixed only half of the use of startTime. Booom.)

startTime is a property of media players, so I am surprised that
LiveCode do not warn me about this. :-o

Also, I will try others less complex and simpler dithering algorithms as
Floyd-Steinberg and Sierra Lite to measure total time differences.

Malte, Thanks again for taking a look and improve this code!
Have a nice weekend!


More information about the use-livecode mailing list