Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
ymvgk
Posts: 3 Joined: 2019-03-16T23:52:52+00:00
Authentication code: 1152
Post
by ymvgk » 2019-03-17T00:12:35+00: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
dlemstra
Posts: 1570 Joined: 2013-05-04T22:28:54+00:00
Authentication code: 6789
Contact:
Post
by dlemstra » 2019-03-17T02:38:38+00:00
You will need to set the colortype of the image to truecolor
ymvgk
Posts: 3 Joined: 2019-03-16T23:52:52+00:00
Authentication code: 1152
Post
by ymvgk » 2019-03-17T08:45:30+00: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: 12159 Joined: 2010-01-24T06:01:33+00:00
Authentication code: 1151
Location: England, UK
Post
by snibgo » 2019-03-17T09:38:24+00: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".
ymvgk
Posts: 3 Joined: 2019-03-16T23:52:52+00:00
Authentication code: 1152
Post
by ymvgk » 2019-03-17T20:21:32+00:00
snibgo wrote: ↑ 2019-03-17T09:38:24+00: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