Skip to content

Instantly share code, notes, and snippets.

@rummelonp
Created October 8, 2011 15:56
Show Gist options
  • Save rummelonp/1272460 to your computer and use it in GitHub Desktop.
Save rummelonp/1272460 to your computer and use it in GitHub Desktop.
jpegからイケメン画像たくさん生成するやつ(Mac用
path = ARGV.shift
if File.exists?(path) && path.match(/^(.+)\.(jpe?g|jp2)$/)
filename = $1
ext = $2
files = []
10.times do |i|
10.times do |j|
if i != j
files << output = "#{filename}_ikemen_#{i}#{j}.#{ext}"
`cat #{path} | sed s/#{i}/#{j}/g > #{output}`
end
end
end
`open -a preview #{files.join(" ")}`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment