Page 1 of 1

How to read a portion of an image using RMagick/ImageMagick?

Posted: 2011-02-18T20:02:51-07:00
by ddayan
I'm trying to load a large image and crop it into tiles really fast and with low memory consumption. An example is the way gdal2tiles script http://www.maptiler.org/ does it, but gdal2tiles doesn't output the tiles the way I want them to be. Therefore I decided to develop my own version using ruby and RMagick(Imagemagick).(gdal2tiles barely uses any memory).

What I notice when using RMgick is that I need to load the whole image to memory first which kinda kills my system. Is there a way to read a portion of a image file manipulate it and then read the rest ?? Or maybe I should do it in some other way or use other libraries.

Re: How to read a portion of an image using RMagick/ImageMag

Posted: 2011-02-18T20:26:53-07:00
by ddayan
I've found the stream option http://www.imagemagick.org/Usage/basics/#stream

How can I use it within my RMagick code ? it seems like the RMagick API doesn't cover it