Thursday, July 10, 2008

Converting in Image in Ruby - Can it get any easier?

require 'RMagick'
Magick::ImageList.new('image.jpg').write('image.tif')


Ok, that is way too short. Let's add crop operation:

image = Magick::ImageList.new('image.jpg')
image.crop(0, 0, 64, 64).write('image.tif')
(I think I can add the first example to Cotta)
Post a Comment