User "snibgo" explained to me (see here) that this functionality does work with ImageMagick in the command line. You simply set the "colorspace" parameter to "gray," and, as confirmed with exiftool, the colorspace correctly changes to Grayscale, and the Number Of Components changes to 1.
The following C# code fails to change the output to grayscale:
Code: Select all
using (MagickImage m = new MagickImage(bmp))
{
m.Format = MagickFormat.Jp2;
//m.Settings.SetDefine(MagickFormat.Jp2, "colorspace", "gray");
//m.Settings.ColorSpace = ColorSpace.Gray;
m.Settings.SetDefine(MagickFormat.Jp2, "quality", "80");
m.Write(jpeg2000FullPath);
}
Can anyone confirm this behavior? Is this a bug? If so, is there somewhere I can file a bug report?