def composite(other_image, output_extension = type.downcase, mask = nil)
      output_tempfile = MiniMagick::Utilities.tempfile(".#{output_extension}")

      MiniMagick::Tool::Composite.new do |composite|
        yield composite if block_given?
        composite << other_image.path
        composite << path
        composite << mask.path if mask
        composite << output_tempfile.path
      end

      Image.new(output_tempfile.path, output_tempfile)
    end
def composite(other_image, output_extension = type.downcase, mask = nil)
      output_tempfile = MiniMagick::Utilities.tempfile(".#{output_extension}")

      MiniMagick::Tool::Composite.new do |composite|
        yield composite if block_given?
        composite << other_image.path
        composite << path
        composite << mask.path if mask
        composite << output_tempfile.path
      end

      Image.new(output_tempfile.path, output_tempfile)
    end
@example
  first_image = MiniMagick::Image.open "first.jpg"
  second_image = MiniMagick::Image.open "second.jpg"
  result = first_image.composite(second_image) do |c|
    c.compose "Over" # OverCompositeOp
    c.geometry "+20+20" # copy second_image onto first_image from (20, 20)
  end
  result.write "output.jpg"

 @see http://www.imagemagick.org/script/composite.php