Code: Select all
var fi2 = new FileInfo(@"....\190132LCZ.psd");
IMagickImage image2 = new MagickImage(fi2);
image2.Resize(new MagickGeometry(-1, 200));
// following 2 lines causes to created invalid image
image2.Grayscale(PixelIntensityMethod.Average);
image2.Quantize(new QuantizeSettings
{
Colors = 256,
ColorSpace = ImageMagick.ColorSpace.Gray
});
image2.Depth = 8;
image2.ColorSpace = ColorSpace.Gray;
image2.Format = MagickFormat.Psd;
image2.AutoOrient();
image2.Write(@".......\22222.psd");
Original file
https://drive.google.com/file/d/1LaKrxc ... sp=sharing
The result file
https://drive.google.com/file/d/1hjtvA7 ... sp=sharing
Magick.net: 7.14