Which API to use to force Grayscale to convert RGB?
Posted: 2017-12-03T22:05:34-07:00
The color space of a picture is Grayscale, the file name is gray.jpg
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:
The color space of the newly generated gray-rgb.jpg remains the same, still Grayscale.
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
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