The following imageMagick command will crop a sprite image into several images divided equally: convert image.png -crop 2x3-40-20@ +repage +adjoin tile-%d.jpg Hot do I do this with Rmagick? But instead of creating multiple files i need to return an array of images.