Sha256: de1206372dcb097789c4043054bf7bdaab782298b502cdb0dca15435b9933104
Contents?: true
Size: 663 Bytes
Versions: 1
Compression:
Stored size: 663 Bytes
Contents
module ImageMosaic module Operations # Takes a composite_image # Can then place another image over the top at x, y coordinates and resized to a dimension. class Compositor def initialize(composite_image, child) @composite_image = composite_image @child = child end def save(type: 'Over') @composite_image.composite(image) do |composite| composite.compose type composite.geometry "+#{@child[:x]}+#{@child[:y]}" end end private def image @image ||= MiniMagick::Image.open(@child[:url]).resize "#{@child[:w]}x#{@child[:h]}^" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
image_mosaic-0.1.3 | lib/image_mosaic/operations/compositor.rb |