Skip to content

Instantly share code, notes, and snippets.

@mrmike
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save mrmike/e03e5c89e2ec622e3bea to your computer and use it in GitHub Desktop.

Select an option

Save mrmike/e03e5c89e2ec622e3bea to your computer and use it in GitHub Desktop.
Image scale
#!/usr/bin/env ruby
require 'rmagick'
require 'fileutils'
start = Time.now.to_i
file_name = ARGV[0]
img = Magick::Image::read(file_name)[0]
output = img.scale(0.5)
output.write("output.png")
diff = Time.now.to_i - start
puts diff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment