20) { $px = 20; } if ($py>20) { $py = 20; } $width = 100; $height = 100; $im = imagecreatetruecolor($width, $height); for ($y=0; $y<$height; $y+= $py) { for ($x=0; $x<$width; $x+= $px) { $c = imagecolorallocate($im, 200-$x, 100+$y, 100+$x-$y); imagefilledrectangle($im, $x, $y, $x+$px, $y+$py, $c); } } header("Content-type: image/png"); imagepng($im); imagedestroy($im);