Skip to content

Instantly share code, notes, and snippets.

@TonsOfFun
Last active January 3, 2016 04:59
Show Gist options
  • Save TonsOfFun/8412642 to your computer and use it in GitHub Desktop.
Save TonsOfFun/8412642 to your computer and use it in GitHub Desktop.
mini_magick to reduce filesize while retaining maximum quality
original_file_path = ''
new_file_path = ''
original_file = MiniMagick::Image.open(original_file_path)
og = original_file
og.combine_options do |ops|
ops.quality "85"
ops.interlace "Plane"
ops.strip
ops.gravity "Center"
ops.resize "640x640^"
ops.crop "640x640+0+0"
end
og.write new_file_path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment