title: Apply watermark with text / image using GraphicsMagick
body: <p>I need to be able to apply watermark on an image, using either text or another image.
  Getting it to work with an image was quite straight forward, using the following command:</p>
  
  <pre><code>gm composite -dissolve 15 -tile logo.png image.jpg wmark_tiled.jpg
  </code></pre>
  
  <p>Now, I also want to be able to use text for watermarking (in other cases). The only thing that I found close to it, is a command from ImageMagick tutorial which is the following :</p>
  
  <pre><code>convert -size 140x80 xc:none -fill grey -gravity NorthWest -draw "text 10,10 'copyrigh text'" -gravity SouthEast -draw "text 5,15 'copyright text'" miff:- | gm composite -tile - image.jpg copyrightImage.jpg 
  </code></pre>
  
  <p>Although its not working in GM, and I would rather avoid using pipe as it causes some headaches managing it from Java.</p>
  
  <p>What I thought I could do, is generate an image from a given text, and then use that image as logo.png is used on my first command. Although I cannot find how to generate an image out of text, all I find is putting text on top of an image. </p>
  
  <p>Ideally I will generate a transparent image with the text, and from what I see modifying font/color etc should be quite flexible. </p>
  
  <p>Any suggestions on how to achieve this, or any better solutions are welcome.
  (I added imagemagick tag as the interfaces are often same/similar)</p>