Ik heb deze php code geschreven, en opzich is er niets fouts aan, maar om een of andere reden stopt hij ermee na 255 pixels gekleurd te hebben.

<?php
error_reporting(E_ALL);
set_time_limit(0);
header("Content-type: image/png");
$im = imagecreate(600, 600)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);

$i = 0;
$rgb = 155;
for ($x = 0; $x < 600; $x++) {
for ($y = 0; $y < 600; $y++) {
$color = imagecolorallocate($im, $rgb, $rgb, $rgb);
imagesetpixel($im, $x, $y, $color);
$i++;
}
}
imagepng($im);
imagedestroy($im);
?>

Een voorbeeld van de output

Reageren