Colour profiles & converting to JP2

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
ozbigben
Posts: 27
Joined: 2012-03-25T02:15:27-07:00
Authentication code: 8675308

Colour profiles & converting to JP2

Post by ozbigben »

Hi All

I found an old post related to this(https://www.imagemagick.org/discourse-s ... hp?t=26210) but thought it might be better to start a new one. I'm looking for a method to save a JP2 with lossless compression and the AdobeRGB colour profile. A command line of:

Code: Select all

convert in.tif -quality 0 out.jp2
... results in a lossless JP2 with an sRGB profile set regardless of the colour profile of the source image. If, for example, this image is then opened in Photoshop the colours will display differently to the original. Assigning (NOT converting) the Adobe RGB profile to the image will display the colour correctly.

Inspecting the JP2 with EXIFTool provides.

Code: Select all

Jpeg2000:MajorBrand=JPEG 2000 Image (.JP2)
Jpeg2000:MinorVersion=0.0.0
Jpeg2000:CompatibleBrands=jp2
Jpeg2000:ImageHeight=nnn
Jpeg2000:ImageWidth=nnn
Jpeg2000:NumberOfComponents=3
Jpeg2000:BitsPerComponent=8 Bits, Unsigned
Jpeg2000:Compression=JPEG 2000
Jpeg2000:ColorSpecMethod=Enumerated
Jpeg2000:ColorSpecPrecedence=0
Jpeg2000:ColorSpecApproximation=Not Specified
Jpeg2000:ColorSpace=sRGB
Are there any options for transferring standard ICC profiles from images to JP2?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Colour profiles & converting to JP2

Post by snibgo »

IM doesn't write profiles to JP2 files.

The standard for JP2 didn't permit display profiles to be embedded until 2013. See http://wiki.opf-labs.org/display/TR/Han ... C+profiles . I don't know if whatever library IM uses for JP2 currently supports embedding profiles in JP2.
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colour profiles & converting to JP2

Post by fmw42 »

IM uses OpenJPEG for JP2 files. I do not know if it supports profiles.
ozbigben
Posts: 27
Joined: 2012-03-25T02:15:27-07:00
Authentication code: 8675308

Re: Colour profiles & converting to JP2

Post by ozbigben »

If it does, it would be a huge benefit to add it to IM. At present, the only option I've found that does it nicely is the J2K Photoshop plugin which is not a practical option for larger scale processing. The lack of metadata transferred is easily fixed with EXIFTool.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Colour profiles & converting to JP2

Post by fmw42 »

Find out if OpenJPEG supports arbitrary profiles. If it does post that to the Developers forum and ask for an enhancement. No guarantees when that might happen as the developers are very busy.
ozbigben
Posts: 27
Joined: 2012-03-25T02:15:27-07:00
Authentication code: 8675308

Re: Colour profiles & converting to JP2

Post by ozbigben »

Sounds like a good plan. I suspect it does but I will verify that. I wouldn't expect the addition to be quick but it'll be worth waiting for.
Post Reply