title: Perl+Image::Magick usage: how to assemble several areas in one image into a new image?
body: <p>I'm new to ImageMagick and haven't figured out how to assemble several areas into a new image.
  E.g., I know the "geometry" of words "hello" and "world" respectively in an image, what I need to do
  is to retrieve the word images and put then into one line image while keep their relative positions. </p>
  
  <p>Question1: Suppose I use the perl API, how should I use Composite() or other correct methods to do this? </p>
  
  <pre><code>my $geom = sprintf('%dx%x+%d+%d', $word-&gt;{width}, $word-&gt;{height}, $offsetx, $offsety); 
  $x = $lineimg-&gt;Composite($wordimg, $geom); 
  warn "$x" if "$x";
  </code></pre>
  
  <p>Suppose $lineimg's size is big enough to hold all word images and the geometry has been computed. 
  This code gives out a complain by ImageMagick:</p>
  
  <pre><code>Exception 410: composite image required `Image::Magick' @ Magick.xs/XS_Image__Magick_Mogrify/7790 ...
  </code></pre>
  
  <p>Question2: currently I only know how to crop a word image out of the original one and then Clone() method
  to restore the original image. Is there a way to copy instead of crop a specific area from a image? This way
  can save the time to copy back and forth the whole image several times. </p>
  
  <p>Does anybody know how to write this kind of processing? I appreciate all your help and suggestions!</p>
  
  <p>-Jin</p>