title: Composite images in Graphicsmagick
body: <p>I'm trying to request an image from an API and "paste" it on top of another image. In Photoshop, I would paste the image into a new layer and then merge the layers. I can accomplish this with Graphicsmagick using gm's composite().</p>
  
  <pre><code>gm().command("composite")
  .in("path/to/topImg.png")
  .in("path/to/bottomImg.png")
  .toBuffer('PNG', function(err, buffer) {
    if (!err) {return buffer;}
  });
  </code></pre>
  
  <p>However, composite only takes file paths. So let's say I want to get the logo from <a href="http://www.google.com" rel="nofollow">http://www.google.com</a>. I could save the image, use it in the code above, and then delete it. What I'm looking for is a way to accomplish this without having to save the image to disk first.</p>