Atkinson dither algorithm

Alex Tweedly alex at tweedly.net
Mon Oct 16 20:08:38 EDT 2017



On 17/10/2017 00:21, Alex Tweedly via use-livecode wrote:

Sorry about the horrible formatting on the last post... I'll try to find 
my Forum password and post the modified version there ....
>
> I haven't tackled the second half (i.e. the actual dithering bit yet - 
> maybe tomorrow).
I can trim a few ms off this, but it's really not significant.

Change the checks for being near the right hand side of the image from 
'if's to a switch.

Then,  after you've calculated and used tNewKey, change following lines 
like :
>
> *if* tPixelPosition modtImageWidth <> 1*then**
>     put (tPixelPosition + tImageWidth - 1) into tNewKey**
>    add*(tDifusionError) totArray2[tNewKey]*
> end* *if*
>
to
>
> *if* tPixelPosition modtImageWidth <> 1*then**
>     add*(tDifusionError) totArray2[tNewKey-1]*
> end* *if*
>
but it really is nit-picking - only a tine saving.

-- Alex.




More information about the use-livecode mailing list