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

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
ddayan
Posts: 6
Joined: 2011-02-18T20:00:39-07:00
Authentication code: 8675308

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

Post 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.
ddayan
Posts: 6
Joined: 2011-02-18T20:00:39-07:00
Authentication code: 8675308

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

Post 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
Post Reply