I am using Magick++ and was wondering what is the most efficient way to crop a Magick::Image and store this cropped region in a new Magick::Image.
The code I am currently using is below, but I think it is inefficient because the whole image is copied:
Code: Select all
Magick::Image img("myImage.jpg");
Magick::Geometry cropRegion(0, 0, 100, 100);
//We need to use a temporary object because "crop" modifies the original image
Magick::Image temp = img;
temp.crop(cropRegion);
temp.display();