Skip to content

Instantly share code, notes, and snippets.

@s4nchez
Created July 25, 2012 19:41
Show Gist options
  • Save s4nchez/3178139 to your computer and use it in GitHub Desktop.
Save s4nchez/3178139 to your computer and use it in GitHub Desktop.
Merge all images in directory into one
#!/bin/bash
brew install imagemagick
gem install rmagick
require 'RMagick'
include Magick
image_files = []
Dir.foreach(".") {|f| image_files << f}
image_files.delete(".")
image_files.delete("..")
images = ImageList.new(*image_files)
res = images.append(false)
res.write("all.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment