title: How can I save an image generated from a php script into an actual .png image?
body: <p>How can I save a php-built-png image as a png file on my server?</p>
  
  <p>For example let's say my script image-builder-png.php generates a blank box png image with the parameters passed to it:</p>
  
  <pre><code>/image-builder-png.php?color=orange&amp;width=100&amp;height=100
  </code></pre>
  
  <p>If I were simply citing this image in HTML this would render fine:</p>
  
  <pre><code>&lt;img src="/image-builder-png.php?color=orange&amp;width=100&amp;height=100"&gt;
  </code></pre>
  
  <p>But I need to pass this image to another server script that only accepts standard image files like <code>orange-box.png</code>.</p>
  
  <p>So how can I "save" the rendered image from <code>/image-builder-png.php?color=orange&amp;width=100&amp;height=100</code> as <code>orange-box.png</code>.</p>