Adds random noise to an image.
theImage - image object
colorize - true or false. Either creates gray or colour noise
theBlend - the level of blending to do. Value between 0-255
theInk - can apply an ink to the overlaying of the noise.
on Noise (theImage, colorize, theBlend, theInk)
theWidth = theImage.width - 1
theHeight = theImage.height - 1
anImage = theImage.duplicate()
if colorize then
newImage = image(anImage.width, anImage.height, 8)
else
newImage = image(anImage.width, anImage.height, 8, #grayscale)
end if
repeat with y1 = 0 to theHeight
repeat with x1 = 0 to theWidth
rnd = random(255)
newImage.setPixel(point(x1,y1), color(rnd))
end repeat
end repeat