The following link has a formula for luminosity.
https://css-tricks.com/manipulating-pixels-using-canvas/
Gray = 0.21R + 0.72G + 0.07B // Luminosity
There are several formulas for gray, and lots and lots of information...
- Brian
There is also code for a canvas full of "noise" or "static", like Max's site now shows.
Each pixel has 4 .data values.
def luminance(pixel): #returns the luminance of a pixel, used in other functions
luminance = (getRed(pixel)+getGreen(pixel)+getBlue(pixel))/3
return luminance
|