Page 1 of 1

Resample questions

Posted: 2019-03-16T17:12:35-07:00
by ymvgk
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

Re: Resample questions

Posted: 2019-03-16T19:38:38-07:00
by dlemstra
You will need to set the colortype of the image to truecolor

Re: Resample questions

Posted: 2019-03-17T01:45:30-07:00
by ymvgk
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?)

Re: Resample questions

Posted: 2019-03-17T02:38:24-07:00
by snibgo
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".

Re: Resample questions

Posted: 2019-03-17T13:21:32-07:00
by ymvgk
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