title: Replace transparency in PNG images with white background
body: <p>I've got some PNG images with transparency, and I need to create versions with the image layer composed onto a white background.  I've tried various things with Image Magick "convert" operations, but either nothing happens at all or I get an error.  I don't want to go to an intermediate JPG form because I don't want the artifacts.  Of course it's easy to do this in Gimp or Photoshop or whatever, but I'd really rather script it from the command line because there  are many of these things.</p>
  
  <p>An example of a non-working Image Magick command is:</p>
  
  <pre><code>convert img1.png -background white -flatten img1-white.png
  </code></pre>
  
  <p>That results in an error.</p>
  
  <p>Thanks!</p>