Skip to content

Instantly share code, notes, and snippets.

@klodio
Forked from bussyjd/For benchmark purposes
Created January 11, 2012 11:50
Show Gist options
  • Save klodio/1594331 to your computer and use it in GitHub Desktop.
Save klodio/1594331 to your computer and use it in GitHub Desktop.
PHP random image generator
<?php
error_reporting(E_ALL);
$limit=10;
$width = 120;
$height = 20;
for($x=0;$x<$limit;$x++) {
$im = @imagecreatetruecolor(1200, 200);
$text_color = imagecolorallocate($im, 233, 14, 91);
$maxrnd = rand(10,70);
for($y=0;$y<$maxrnd;$y++) {
imagestring($im, 10+$y*2, 50+$y*2, 50+$y*2, 'StacktextBENCHMARKPOWAjd+klodio nyan', $text_color);
};
imagejpeg($im,"jd/image$x.jpg",100);
echo "image $x\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment