Created
July 12, 2010 18:42
-
-
Save alunny/472884 to your computer and use it in GitHub Desktop.
convert image with image_science
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/ruby | |
# usage: ruby convert.rb icon.jpg png | |
require 'rubygems' | |
require 'image_science' | |
if ARGV.length == 2 | |
source_file = ARGV.first | |
target_extension = ARGV.last | |
target_file = source_file.sub /[\w\d]+$/, target_extension | |
ImageScience::with_image(source_file) do |img| | |
img.save(target_file) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment