lib/image_processing/mini_magick.rb
def composite(overlay = :none, mask: nil, mode: nil, gravity: nil, offset: nil, args: nil, **options, &block)
        return magick.composite if overlay == :none

        if options.key?(:compose)
          warn "[IMAGE_PROCESSING] The :compose parameter in #composite has been renamed to :mode, the :compose alias will be removed in ImageProcessing 2."
          mode = options[:compose]
        end

        if options.key?(:geometry)
          warn "[IMAGE_PROCESSING] The :geometry parameter in #composite has been deprecated and will be removed in ImageProcessing 2. Use :offset instead, e.g. `geometry: \"+10+15\"` should be replaced with `offset: [10, 15]`."
          geometry = options[:geometry]
        end
        geometry = "%+d%+d" % offset if offset

        overlay_path = convert_to_path(overlay, "overlay")
        mask_path    = convert_to_path(mask, "mask") if mask

        magick << overlay_path
        magick << mask_path if mask_path

        magick.compose(mode) if mode
        define(compose: { args: args }) if args

        magick.gravity(gravity) if gravity
        magick.geometry(geometry) if geometry

        yield magick if block_given?

        magick.composite
      end
# Overlays the specified image over the current one. Supports specifying
# an additional mask, composite mode, direction or offset of the overlay
# image.
Overlays the specified image over the current one. Supports specifying
an additional mask, composite mode, direction or offset of the overlay
image.
Overlays the specified image over the current one . Supports specifying an additional mask composite mode direction or offset of the overlay image .
def composite(overlay = :none, mask: nil, mode: nil, gravity: nil, offset: nil, args: nil, **options, &block)
        return magick.composite if overlay == :none
        if options.key?(:compose)
          warn "[IMAGE_PROCESSING] The :compose parameter in #composite has been renamed to :mode, the :compose alias will be removed in ImageProcessing 2."
          mode = options[:compose]
        end
        if options.key?(:geometry)
          warn "[IMAGE_PROCESSING] The :geometry parameter in #composite has been deprecated and will be removed in ImageProcessing 2. Use :offset instead, e.g. `geometry: \"+10+15\"` should be replaced with `offset: [10, 15]`."
          geometry = options[:geometry]
        end
        geometry = "%+d%+d" % offset if offset
        overlay_path = convert_to_path(overlay, "overlay")
        mask_path    = convert_to_path(mask, "mask") if mask
        magick << overlay_path
        magick << mask_path if mask_path
        magick.compose(mode) if mode
        define(compose: { args: args }) if args
        magick.gravity(gravity) if gravity
        magick.geometry(geometry) if geometry
        yield magick if block_given?
        magick.composite
      end
def composite ( overlay = :none , mask : nil , mode : nil , gravity : nil , offset : nil , args : nil , ** options , & block ) return magick . composite if overlay == :none if options . key? ( :compose ) warn "[IMAGE_PROCESSING] The :compose parameter in #composite has been renamed to :mode, the :compose alias will be removed in ImageProcessing 2." mode = options [ :compose ] end if options . key? ( :geometry ) warn "[IMAGE_PROCESSING] The :geometry parameter in #composite has been deprecated and will be removed in ImageProcessing 2. Use :offset instead, e.g. `geometry: \"+10+15\"` should be replaced with `offset: [10, 15]`." geometry = options [ :geometry ] end geometry = "%+d%+d" % offset if offset overlay_path = convert_to_path ( overlay , "overlay" ) mask_path = convert_to_path ( mask , "mask" ) if mask magick << overlay_path magick << mask_path if mask_path magick . compose ( mode ) if mode define ( compose : { args : args } ) if args magick . gravity ( gravity ) if gravity magick . geometry ( geometry ) if geometry yield magick if block_given? magick . composite end
Overlays the specified image over the current one.
Overlays the specified image over the current one .
overlay
mask
mode
gravity
offset
args
options
block