Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def split_images
- #'image' is a ImageMagick Object
- width = image.cols/number_cols
- height = image.rows/nubmer_rows
- images = []
- 0.upto(number_rows-1) do |x|
- 0.upto(number_cols-1) do |y|
- images << image.crop( Magick::NorthWestGravity, x*width, y*height, width, height, true)
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement