Programmatically determine the average greyscale

-hh hh at livecode.org
Fri Feb 19 16:05:34 EST 2016


BR,

you do estimate the luminance of a 120x175 = 21000 px region
on base of the evaluation of ONE single deterministic pixel?

Accepted, of course, but then it may be better, from a
probabilistic point of view, not to take "the" pixel (40,40)
but *any* randomly chosen pixel of that region.

You could do for that:

  set randomseed to (char -8 to -1 of the millisecs)
  put 19+random(120) into pX ; put 19+random(175) into pY

==
hh

p.s. Sorry for giving this advice, but "randomness" was my
job's field and is still my passion.




More information about the use-livecode mailing list