Converting One Image Format to Another using Ruby

Insert the following code in your Ruby file.
 require 'rubygems'
 require 'RMagick'
img ="image.png").first
 img.write("image.jpg")                 # Writes a JPEG
 img.write("image.gif")                 # Writes a GIF
 img.write("JPG:image")                 # Writes a JPEG
 img.write("JPG:image.gif")             # Writes a JPEG


Popular posts from this blog

Interview Question on Ruby on Rails

Inserting and Moving elements inside Ruby Array