Resample questions

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
ymvgk
Posts: 3
Joined: 2019-03-16T16:52:52-07:00
Authentication code: 1152

Resample questions

Post by ymvgk » 2019-03-16T17:12:35-07:00

I am using Q16-AnyCPU version to resample a 24-bit TIFF image

Code: Select all

   using (var image = new MagickImage(imageFileName))
            {
       
                image.Resample(new PointD(600));


                
                image.Write(outputFile);
            }
The problem is that the output image is not 24-bit but 8-bit, and the loaded image is also 8-bit. What am I doing wrong?


That's the command I need to implement:

convert input.tif -units PixelsPerInch -filter Point-resample 600 -type TrueColor output.tif

User avatar
dlemstra
Posts: 1563
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: Resample questions

Post by dlemstra » 2019-03-16T19:38:38-07:00

You will need to set the colortype of the image to truecolor
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate

ymvgk
Posts: 3
Joined: 2019-03-16T16:52:52-07:00
Authentication code: 1152

Re: Resample questions

Post by ymvgk » 2019-03-17T01:45:30-07:00

That helps, but why isn't it loading image properly right from the file? There's a TrueColor image in, I expect that ColorType would be TrueColor after the image is loaded.

And is it possible to specify the filter for the Rescale somehow (Point in command-line equivalent?)

snibgo
Posts: 11923
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Resample questions

Post by snibgo » 2019-03-17T02:38:24-07:00

ymvgk wrote:And is it possible to specify the filter for the Rescale somehow
Yes. Eg at the CLI, give "-filter Box" or whatever before "-resample".
snibgo's IM pages: im.snibgo.com

ymvgk
Posts: 3
Joined: 2019-03-16T16:52:52-07:00
Authentication code: 1152

Re: Resample questions

Post by ymvgk » 2019-03-17T13:21:32-07:00

snibgo wrote:
2019-03-17T02:38:24-07:00
ymvgk wrote:And is it possible to specify the filter for the Rescale somehow
Yes. Eg at the CLI, give "-filter Box" or whatever before "-resample".
Not in the CLI, I meant Magick.NET

Post Reply