troosh / openjpeg

Automatically exported from code.google.com/p/openjpeg
Other
0 stars 0 forks source link

Access to raw ICC profile data #45

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
As an alternative to using the "little CMS" library for color management, it 
would be nice to expose the raw ICC profile information embedded in some 
images. The attached patch adds two parameters to the opj_image_t struct - a 
pointer to a buffer for the raw data, and an integer for the length of that 
buffer. The JP2 decode function then sets these parameters if an ICC profile 
was present in the image. Finally image.c was modified to free the buffer, it 
if exists, when calling opj_image_destroy, rather than destroying it 
immediately after applying the profile. 

Presently I believe that an image with an embedded ICC profile will be marked 
as "CLRSPC_UNKNOWN" regardless of wether the ICC was actually successfully 
applied to the image or not. I think that if the ICC profile is being exposed 
to the user, they would want to know wether the raw data in the component 
arrays has been transformed by the ICC profile or not (to avoid applying it 
twice, or perhaps simply to be able to convey more information about an image's 
color space to an end-user). Perhaps something like "CLRSPC_IMAGE_ICC" in 
addition to CLRSPC_UNKNOWN? 

Original issue reported on code.google.com by apangb...@gmail.com on 4 Nov 2010 at 5:43

Attachments:

GoogleCodeExporter commented 9 years ago
The ICC profile is now managed outside libopenjpeg and is available in the 
opj_image_t structure, as proposed.

Second part of the issue still needs investigation. Patch welcome.

Original comment by anto...@gmail.com on 9 Dec 2010 at 9:36

GoogleCodeExporter commented 9 years ago

Original comment by mathieu.malaterre on 25 Feb 2014 at 3:22