There is an in-place version of crop
called crop!
:
img.crop!(x, y, width, height) -> self
img.crop!(gravity, x, y, width, height) -> self
img.crop!(gravity, width, height) -> self
The in-place form of
crop
.
so you can say:
@image = Magick::ImageList.new(path).crop!(10,10,20,20)
if you want to avoid making a copy. Or you could let the GC deal with it and say:
@image = Magick::ImageList.new(path).crop(10,10,20,20) # No `!` here