Trying to create a JP2 with an Adobe RGB ICC profile

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Rich1177

Trying to create a JP2 with an Adobe RGB ICC profile

Post by Rich1177 »

Is there any way for CONVERT to produce a .JP2 with an Adobe RGB ICC profile? Any combination of -profile switches I have used result in a .JP2 that has an sRGB tag. My source file contains ARGB data. In some cases, the data in the resulting .JP2 is actually ARGB (but is tagged sRGB) and then it looks bad. I can get convert to change the data to sRGB so it looks OK, but I would prefer to keep it in ARGB and have it tagged correctly. Thanks for any ideas.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Trying to create a JP2 with an Adobe RGB ICC profile

Post by magick »

The Jasper library supports two colorspaces for RGB and ARGB: sRGB and generic RGB. Well actually three, there is also an Unknown colorspace. What do you recommend as the colorspace setting for ARGB images?
Rich1177

Re: Trying to create a JP2 with an Adobe RGB ICC profile

Post by Rich1177 »

I'm not sure I understand the question - there are definitely things I don't understand about color spaces. Let me explain more:
I have an JP2 created by Photoshop which Bridge says has Color Profile: Adobe RGB (1998). If I try this command:
convert ARGB-16.jp2 -profile AdobeRGB1998.icc -profile AdobeRGB1998.icc result-ARGB-16.jp2
I get a file which Bridge says has Color Profile: sRGB IEC61966-2.1. Looking at the preview in Bridge, the converted file has colors that look faded, suggesting that the data was not modified by the convert, but is not tagged correctly. If I open the converted file in Photoshop, and do an assign-profile (not convert-to-profile) the colors then look correct. I have been unable to find a convert command which will yield a file tagged with Adobe RGB (1998)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Trying to create a JP2 with an Adobe RGB ICC profile

Post by magick »

To ensure the color conversion works properly, type
  • identify -list configure
and verify that lcms is associated with the DELEGATES tag.

Unfortunately, ImageMagick does not embed a color profile within the JP2 image format. Its possible the Jasper library supports an embedded profile but we have not investigated it just yet. ImageMagick is open-source so you can investigate yourself and post a patch here for coders/jp2.c if you have the time.
Post Reply