Skip to content

Instantly share code, notes, and snippets.

@ruedap
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruedap/10866107 to your computer and use it in GitHub Desktop.
Save ruedap/10866107 to your computer and use it in GitHub Desktop.
Convert to .jpg from .png using RMagick
require 'pathname'
require 'rmagick'
images = Dir['*.png']
images.each {|image| i = Magick::Image.read(image).first; i.write(Pathname(image).sub_ext('.jpg')) { self.format='JPEG'; self.quality=80; }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment