Skip to content

Instantly share code, notes, and snippets.

@colorbox
Created August 18, 2018 15:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save colorbox/e323b9555ee161acb9b9a5dd44e694ad to your computer and use it in GitHub Desktop.
crop image with RMagick
require 'RMagick'
original = Magick::Image.read('original.jpg').first
image = original.crop(0, 0, 10, 10)
image.write('cropped.jpg')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment