From Sludgy Zebra, 4 Years ago, written in Plain Text.
Embed
  1. <?php
  2. header("Content-type: image/png");
  3. $sizex=800;
  4. $sizey=800;
  5.  
  6. $img = imagecreatetruecolor(3 * $sizex,$sizey);
  7. $r = imagecolorallocate($img,255, 0, 0);
  8. $g = imagecolorallocate($img,0, 255, 0);
  9. $b = imagecolorallocate($img,0, 0, 255);
  10. imagefilledrectangle($img, 0, 0, 3 * $sizex, $sizey, imagecolorallocate($img, 255, 255, 255));
  11.  
  12. $p = 0;
  13. for($i=0; $i < 100000; $i++) {
  14.     $np = rand(0,$sizex);
  15.     imagesetpixel($img, $p, $np, $r);
  16.     $p = $np;
  17. }
  18.  
  19. $p = 0;
  20. for($i=0; $i < 100000; $i++) {
  21.     $np = mt_rand(0,$sizex);
  22.     imagesetpixel($img, $p + $sizex, $np, $g);
  23.     $p = $np;
  24. }
  25.  
  26. $p = 0;
  27. for($i=0; $i < 100000; $i++) {
  28.     $np = floor($sizex*(hexdec(bin2hex(openssl_random_pseudo_bytes(4)))/0xffffffff));
  29.     imagesetpixel($img, $p + (2*$sizex), $np, $b);
  30.     $p = $np;
  31. }
  32.  
  33. imagepng($img);
  34. imagedestroy($img);
  35. ?>