title: PHP GD: The image cannot be displayed because it contains errors
body: <p>I try to make Captcha via PHP GD. But unfortunately I encounter to a problem!
  PHP tell me:</p>
  
  <pre><code>The image “http://127.0.0.1/par.php” cannot be displayed because it contains errors.
  </code></pre>
  
  <p>My code is this</p>
  
  <pre><code>&lt;?php
  
    header ('Content-Type: image/png');
    $im = @imagecreatetruecolor(120, 20)
          or die('Cannot Initialize new GD image stream');
    $text_color = imagecolorallocate($im, 233, 14, 91);
    $red = imagecolorallocate($im, 255, 0, 0); 
    for ($i=0;i&lt;=120;$i=$i+1){
        for ($j=0;$j&lt;=20;$j=$j+1){
            imagesetpixel($im, $i,$j,$red);
        }
    }
    imagestring($im, 1, 5, 5,  'A Simple Text String', $text_color);
    imagepng($im);
    imagedestroy($im);
  ?&gt;
  </code></pre>