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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
jmverdone
Posts: 2
Joined: 2019-07-11T07:36:17-07:00
Authentication code: 1152

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

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
jmverdone
Posts: 2
Joined: 2019-07-11T07:36:17-07:00
Authentication code: 1152

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

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

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

Post 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.
snibgo's IM pages: im.snibgo.com
Post Reply