Atkinson dither algorithm
Alejandro Tejada
capellan2000 at gmail.com
Mon Oct 16 14:37:06 EDT 2017
Hi Bob,
Bob Sneidar wrote:
> I didn't post any code I don't think, but I will certainly
> take some credit for having done so! ;-)
In fact, you are not late! :-D
Please, take a look at the script of
Atkinson Dither 04 (Fastest Version)
and make it faster.
How would you do this?
Making the Functions Private (so they are not
available in the message path)?
Converting some variables to constants?
(like the black and white pixels and many
other variables that do not change at all
inside the handler)
The main difference between V04 and V03
of this handler is a single modification:
An arithmetic operation like ADD:
> add (tDifusionError) to tArray2[tNewKey]
replaced all instances of PUT
variable + variable into array
like in this line:
> put (tDifusionError) + tArray2[tNewKey] into tArray2[tNewKey]
This single change speed the handler (in my own setup)
by a whopping 33%. Just replacing "put" with "add"
Please take a look! :-)
(Download only the stack at the end of this thread)
https://forums.livecode.com/viewtopic.php?f=10&p=159173#p159173
Al
More information about the use-livecode
mailing list