First I\'m referring to a previous question Change image per pixel and save to db
I found that the html5 canvas isn\'t suitable because it\'s hard to keep the source-ima
replace RANDOM_COLOR with your random color value
this will replace all the pixels ,
for($i=0;$i < $x;$i++) {
for($e = 0;$e < $y;$e++) {
imagesetpixel($gd, $i,$e, $RANDOM_COLOR);
}
}
if you want to set only a few random pixels , make sure you set them in a 0 and width -1, 0 and height -1 range
for example
$i = rand(0,$width-1);
$e = rand(0,$height - 1);
imagesetpixel($gd, $i,$e, $RANDOM_COLOR);
you could use it in a loop