Page 1 of 1

Faster subimage extraction?

Posted: 2010-09-25T03:36:47-07:00
by dproc
I want to create a new image composed of a small rectangular region from an existing image. I can copy all the pixels of the existing image into a new image and then crop the new image, but I wonder if there is a way to avoid copying all those pixels (I need speed).

I'm working with Magick++ but any command-line ideas will be helpful because they might show me how to do it in Magick++.

And if there's no way to do this, might I suggest a new Image constructor that takes a Geometry describing the source sub-image?

All thoughts, ramblings, help will be appreciated.

Re: Faster subimage extraction?

Posted: 2010-09-26T19:11:15-07:00
by anthony
If you need to preserve the original image in memory, why not clone it first, then crop it.