title: Convert .BMP to .PNG with PHP
body: <p>I needed to be able to convert different image formats to the .PNG format. With the help of some others, I was able to make that happen. The only issue is, I also need to be able to convert .BMP files to .PNG without the use of ImageMagick.</p>
  
  <p><strong>Here is the code I used for the conversion of other files:</strong></p>
  
  <pre><code>&lt;?php
   $filename = "myfolder/test.jpg";
   $jpg = @imagecreatefromjpeg($filename);
   if ($jpg)
   {
     header("Content-type: image/png");
     imagepng($jpg);
     imagedestroy($jpg);
     exit;
   }
  ?&gt;
  </code></pre>
  
  <p>If anyone knows how I would go about converting this, please let me know. All help is welcome and appreciated.</p>