title: how to edit image using php
body: <p>I have written following set of codes.</p>
  
  <pre><code>$image = ImageCreate(200, 50);
  $background_color = ImageColorAllocate($image, 255, 255, 255); // white
  $gray = ImageColorAllocate($image, 204, 204, 204); // gray
  ImageFilledRectangle($image, 50, 10, 150, 40, $gray);
  header('Content-type: image/png');
  ImagePNG($image);
  </code></pre>
  
  <p>while running this code I get an error</p>
  
  <pre><code>The image "http://localhost/app/" cannot be displayed because it contains errors.
  </code></pre>
  
  <p>Please help me.</p>