Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/usr/bin/env ruby
require 'pry'
require 'pathname'
if ARGV.count != 3
puts "usage: #{__FILE__} <TEMPLATE_IMAGE> <SOURCE_DIR> <DEST_DIR>"
exit(1)
end
template_image = Pathname.new(File.expand_path(ARGV[0]))
source = Pathname.new(File.expand_path(ARGV[1]))
dest = Pathname.new(File.expand_path(ARGV[2]))
source.each_child do |source_image|
dest_image = dest.join(source_image.basename)
`composite -compose Dst_Out -gravity center #{source_image.to_s} #{template_image.to_s} -alpha Set #{dest_image.to_s}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.