単純画像変換メモ

require 'RMagick'
def show_props(path)
image = Magick::Image::read(path).first
puts " Format: #{image.format}"
puts " Geometry: #{image.columns}x#{image.rows}"
puts " Depth: #{image.depth} bits-per-pixel"
puts " Colors: #{image.number_colors}"
puts " Filesize: #{image.filesize}"
puts " Resolution: #{image.x_resolution.to_i}x#{image.y_resolution.to_i} " +
"pixels/#{image.units == Magick::PixelsPerInchResolution ?
"inch" : "centimeter"}"
end

(src, dest) = ARGV
raise unless src && dest
image = Magick::Image::read(src).first
image.write(dest)
#show_props(dest)