Neolix: [PHP] imagecolorallocate auf 256 Werte beschränkt?

Beitrag lesen

Also, ich erzeuge ein JPEG per "imagejpeg($image);"

Der Code sieht so aus:

$image = imagecreate(150,150);
$farbe_body=imagecolorallocate($image,255,255,255);

for($x=0;$x<=150;$x++)
{
 for($y=0;$y<=150;$y++)
 {
  $r = round($x / 150 * 255);
  $g = round(255 - ($y / 150 * 255));
  $b = round(255 - ($x / 150 * 255));
  $px_color = imagecolorallocate($image,$r,$g,$b);
                #print $px_color;
  imagesetpixel($image, $x, $y, $px_color);
 }
}
imagejpeg($image,"",100);

Und wenn ich jetzt "print $px_color;" auskommentiere,
dann gibt er mir folgendes aus:
0
1
2
3
.
.
.
254
255
-1
-1
-1
-1