Creating thumbnails or resizing image efficiently

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
mcoburn
Posts: 1
Joined: 2013-05-06T10:58:53-07:00
Authentication code: 6789

Creating thumbnails or resizing image efficiently

Post by mcoburn »

Suppose that I have a large image 256 MB in size. If I wanted to resize the image or create a thumbnail, I would assume that ImageMagick is careful to not read the entire source file into memory.

- What are the size(s) of the buffer(s) that are used internally by ImageMagick?
- Are there any problems compiling or using ImageMagick for ARM devices?
- Is the following a correct way to instruct ImageMagick to create a thumbnail efficiently from a memory usage perspective. I don't mind if the entire thumbnail bytes are stored in memory temporarily?:

I am using mono by the way:

Code: Select all

ImageMagick.WandGenesis();
IntPtr wand = ImageMagick.NewWand();

ImageMagick.ThumbnailImage(wand, (IntPtr)thumbWidth, (IntPtr)thumbHeight);
			
var thumbnailBytes = ImageMagick.GetImageBlob(wand) as byte[];

ImageMagick.DestroyWand(wand);
ImageMagick.WandTerminus();
			
return thumbnailBytes;
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Creating thumbnails or resizing image efficiently

Post by magick »

Post Reply