Skip to content

Instantly share code, notes, and snippets.

@Tolia
Created March 24, 2017 07:41
Show Gist options
  • Save Tolia/b7190fb8b27325afe8caee41ae784237 to your computer and use it in GitHub Desktop.
Save Tolia/b7190fb8b27325afe8caee41ae784237 to your computer and use it in GitHub Desktop.
imagemagick-collage-ruby.rb
require 'mini_magick'
files = Dir[Dir.pwd + "/src/*.jpg"]
tile = "#{files.length}x1"
montage = MiniMagick::Tool::Montage.new
files.each { |image| montage << image }
montage << '-mode'
montage << 'Concatenate'
montage << '-background'
montage << 'none'
montage << '-tile'
montage << tile
montage << Dir.pwd + "/out/test.jpg"
montage.call
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment