title: PHP: create image with ImagePng and convert with base64_encode in a single file?
body: <p>I have created an image with ImagePng(). I dont want it to save the image to the file system but want to output it on the same page as base64 encode inline Image, like</p>
  
  <pre><code>print '&lt;p&gt;&lt;img src="data:image/png;base64,'.base64_encode(ImagePng($png)).'" alt="image 1" width="96" height="48"/&gt;&lt;/p&gt;';
  </code></pre>
  
  <p>which does not work.</p>
  
  <p>Is this possible in a single PHP file at all?</p>
  
  <p>Thanks in advance!</p>