title: Error in creating png with imagecreate in php
body: <p>I am working on creating captcha and this is my script for creating captcha image.</p>
  
  <pre><code>    header("Content-type: image/png");
  $width              = 100;
  $height             = 40;
  $im                 = ImageCreate($width, $height);
  
  $bg                 = ImageColorAllocate($im, 250, 250, 250);
  
  $border             = ImageColorAllocate($im, 191, 191, 191);
  ImageRectangle($im, 0, 0, $width - 1, $height - 1, $border);
  
  $text               = base64_decode($GLOBALS["captcha_akey"]);
  
  $textcolor          = ImageColorAllocate($im,0,5,5);
  
  $font               = 3;
  
  $font_width         = ImageFontWidth($font);
  $font_height        = ImageFontHeight($font);
  
  $text_width         = $font_width * strlen($text);
  
  $position_center    = ceil(($width - $text_width) / 2);
  
  $text_height        = $font_height;
  
  $position_middle    = ceil(($height - $text_height) / 2);
  
  ImageString($im, $font, $position_center, $position_middle, $text, $textcolor);
  
  ImagePNG($im);
  </code></pre>
  
  <p>Captcha displaying correctly but at the top of captcha I found this error.</p>
  
  <pre><code>    �PNG  IHDRd(u�� PLTE������IDAT8�퓻 �0DU�M�R�Y"�*=���)C)T�"��pXH���$����|�˟�$�9N����$獌�@�54�i[ -Hi\ku7��&amp;Y���АLA�h;�Ah�^u�*���5 I:;���\�pd;��;ߓ�6b�(���'P�SY���IEND�B`�
  </code></pre>