title: Drawing rectangles in php not working
body: <p>I am creating an image in php and populating it with 10x10 pixel rectangles filled with a color. </p>
  
  <pre><code>$image = imagecreate(150,150);
  $background = imagecolorallocate($image, 0, 0, 0); //black background
  for ($row=0; $row &lt; 15; $row++) { 
      for ($col=0; $col &lt; 15; $col++) { 
          $x1 = 10* $col;
          $y1 = 10*$row;
          $x2 = 10*($col + 1);
          $y2 = 10*($row + 1);
  
          imagefilledrectangle($image, $x1,$y1,$x2,$y2, imagecolorallocate($image, 100,100,100)); //grey rectangle
      }
  }
  
  imagepng($image, "ciph.png");
  </code></pre>
  
  <p>This works for small images no bigger than 150x150 pixels and i get a completely grey filled rectangle. but soon as i try bigger images. it only adds rectangles to part of the image. Any idea what is causing this? it appears there is a limit on the number of individual objects i can draw.</p>
  
  <p><a href="https://i.stack.imgur.com/AEvws.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AEvws.png" alt="enter image description here"></a></p>
  
  <p>15x15</p>
  
  <p><a href="https://i.stack.imgur.com/ZdEeM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZdEeM.png" alt="enter image description here"></a></p>
  
  <p>18x18</p>
  
  <p>ive counted and it appears to only draw 256 rectangles... doesnt seem like a coincidence that that is 2 to the 8th power.</p>
  
  <p>Any help would be much appreciated! thanks.</p>