Page 1 of 1

Convert from GrayScale, or Index to RGB and keep ICC profile.

Posted: 2019-07-11T07:40:23-07:00
by jmverdone
I have several images PNG that I need to convert from a Grayscale or Indexed to and RGB. This needs to be done while also adding an icc (ADOBERGB1998.icc) profile.

The issue I'm running into is that I can convert to RGB or add the i can't do both.

Re: Convert from GrayScale, or Index to RGB and keep ICC profile.

Posted: 2019-07-11T08:20:28-07:00
by snibgo
What version of IM, on what platform?

By "while also adding an icc (ADOBERGB1998.icc) profile" do you mean you want to merely assign that profile, or do you want to convert from something else to that profile?

To merely assign, or to convert from an embedded profile:

Code: Select all

magick in.png -profile AdobeRGB1998.icc RGB24:out.png
magick: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `out.png' @ warning/png.c/MagickPNGWarningHandler/1744.
Don't worry about the warning.

Re: Convert from GrayScale, or Index to RGB and keep ICC profile.

Posted: 2019-07-11T10:10:21-07:00
by jmverdone
The files are currently stored as 8bit PNGs. ImageMacgick has opimized them to be RGB, Grayscale or Indexed.

Our printers (Kornit D2G) only accepts RGB files with an ICC profile.

The issue I have is if I force RGB the color profile is stripped out. If I add a color profile the image will optimize to RGB, Index, Grayscale if needed.

Re: Convert from GrayScale, or Index to RGB and keep ICC profile.

Posted: 2019-07-11T10:22:40-07:00
by snibgo
I repeat: What version of IM, on what platform?

Did you try my command?

Please post a link to a sample input file.