LoginSignup
0
0

More than 5 years have passed since last update.

画像から任意の矩形を切り取る

Posted at

RMagick を利用して、画像から任意の矩形を切り取り、その画像を新たな画像として保存できる。

require 'RMagick'

original = Magick::Image.read('original.jpg').first
image = original.crop(0, 0, 10, 10)
image.write('cropped.jpg')
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0