For each pixel in pic:
r= random()
if r < 0.25:
set the red level to randrange(0,256),
set the green level to randrange(0,256)
set the blue level to randrange(0,256)
The rest of the unseen code is correct, I just can't figure out how to phrase this function well enough for it to work.