Page 1 of 1

Resize during image read in Magick.NET

Posted: 2019-11-25T00:53:41-07:00
by VasyaIvonov2

I have read about 'Resize During Image Read':
The resize operator can also be applied to images immediately after being read, before it is added to the current image sequence and the next image is read. That way a minimal amount of memory is needed to read in a lot of images. Example:
convert dragon.gif'[64x64]' read_dragon.gif
I want use this feature in C# (with Magick.NET lib). But I can't find out how to do this. I tried to use next:

Code: Select all

            MagickReadSettings rs = new MagickReadSettings()
                Width = 100,
                Height = 100

            using (MagickImage image = new MagickImage("MyBigTifFile.tif", rs))
But 'MyBigTifFileThumb.tif' is the same size as source image. I can resize by calling image.Resize, but it will do after image read.

Re: Resize during image read in Magick.NET

Posted: 2019-11-25T08:12:07-07:00
by snibgo
The example you show has the size appended to the filename, so try that:

Code: Select all

using (MagickImage image = new MagickImage("MyBigTifFile.tif[64x64]", rs))