Use convert.exe-type truecolor to convert RGB color space from Grayscale.
convert gray.jpg -type truecolor gray-rgb.jpg
However, I now need to use the ImageMagick API to complete the conversion:
Code: Select all
MagickWand * mw = NewMagickWand ();
MagickReadImage (mw, "gray.jpg");
MagickSetImageType (mw, TrueColorType);
MagickSetImageColorspace (mw, sRGBColorspace);
MagickSetImageFormat(mw, "JPEG");
MagickWriteImage (mw, "gray-rgb.jpg")
google the relevant information, find the same problem, but did not find the answer:
https://www.imagemagick.org/discourse-s ... php?t=6888
Which ImageMagick API to use to force Grayscale to convert RGB?
Thank you