Bug 223232

Summary: Digikam Does Not Detect the Color Profile in DCF Files
Product: [Applications] digikam Reporter: Frank Gore <gore>
Component: ColorManagement-ProfilesAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: caulier.gilles, marcel.wiesweg
Priority: NOR    
Version: 1.0.0   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 2.6.0
Sentry Crash Report:

Description Frank Gore 2010-01-18 02:30:51 UTC
Version:           1.0.0 (using KDE 4.3.1)
OS:                Linux
Installed from:    openSUSE RPMs

All modern cameras use DCF 2.0 when generating images. According to DCF 2.0 (which is based on EXIF 2.21), the color profile is specified as part of the EXIF metadata, not embedded as an ICC profile.

As far as I can tell, Digikam does not detect the appropriate color profile when viewing or opening pictures from cameras that use DCF 2.0.

The following applies to the viewer:
For example, if I have the "Working Color Space" set to sRGB, any pictures I took while my camera was set to Adobe RGB end up looking washed out and bland. If I have the "Working Color Space" set to Adobe RGB, any pictures from a camera that was set to sRGB come out over-saturated.

The following applies to the editor:
If I open a picture that adheres to the DCF 2.0 specification, no color profile is detected. I can set Digikam to ask me which profile should be assigned to the picture, but that leaves me guessing. I have no way of knowing what it "should" be unless I wade through the EXIF data myself beforehand, or I've memorized which picture was in which color space.

All of this completely defeats the whole point of seamless color management. The color profile is specified properly, Digikam just doesn't see it.

The DCF 2.0 specification can be found here, but it must be purchased (which sucks):
http://www.jeita.or.jp/english/standard/html/1_4.html
Comment 1 caulier.gilles 2010-01-18 08:53:48 UTC
It's cleary an Exiv2 library stuff. Which Exiv2 version you use with digiKam ? Go to Help/Component info for details.

Try to use Exiv2 command line tool with your DCF files to see if you can identify Color Profile.

Gilles Caulier
Comment 2 Frank Gore 2010-01-18 15:26:10 UTC
I'm using libexiv2 0.18.2.

This is a quote from a developer on the LittleCMS mailing list (where I brought up this issue before filing a bug here):

On Sun, Jan 17, 2010 at 7:32 AM, Larry Reeve <larry@polybytes.com> wrote:
> The first image is in "DCF Colorspace". This can be seen from the following
> entries in the EXIF:
>
> Color Space:    Uncalibrated
> WhitePoint X:   0.31
> WhitePoint Y:   0.33
> Chromaticity Red(X):    0.64
> Chromaticity Red(Y):    0.33
> Chromaticity Green(X):  0.21
> Chromaticity Green(Y):  0.71
> Chromaticity Blue(X):   0.15
> Chromaticity Blue(Y):   0.06
> YCbCrCoefficient 1:     0.30
> YCbCrCoefficient 2:     0.59
> YCbCrCoefficient 3:     0.11
>
> A DCF aware application sees this information and processes the image
> accordingly (which means use an Adobe RGB profile).

And a further reply when I asked if this was an application-level or library-level issue:

On Sun, Jan 17, 2010 at 5:03 PM, Larry Reeve <larry@polybytes.com> wrote:
> LCMS does not have anything to do with the color space defined in the EXIF
> block of a JPEG file. There is no embedded profile. It is up to the
> application using LCMS to evaluate the color space definitions in the EXIF
> and take the action to load and use an Adobe RGB profile if it is needed.
> The DCF Optional Color Space (see paragraph 6.2 of of JEITA CP-3461 "Design
> rule for Camera File system DCF Version 2.0") defines the values that should
> alert an application to take this action:
>
> Color Space:    Uncalibrated
> WhitePoint X:   0.31
> WhitePoint Y:   0.33
> Chromaticity Red(X):    0.64
> Chromaticity Red(Y):    0.33
> Chromaticity Green(X):  0.21
> Chromaticity Green(Y):  0.71
> Chromaticity Blue(X):   0.15
> Chromaticity Blue(Y):   0.06
> YCbCrCoefficient 1:     0.30
> YCbCrCoefficient 2:     0.59
> YCbCrCoefficient 3:     0.11

Here are two files straight from my camera as examples. One is in sRGB colorspace, the other is in Adobe RGB colorspace. Both conform to the DCF 2.0 specification. Both have their color space detected properly in commercial applications.

sRGB:
http://lh3.ggpht.com/_HAZjMzZWrtc/S05qk1yxBOI/AAAAAAAABC0/5kXGfiIIF7s/d/GORE3360.JPG

Adobe RGB:
http://lh6.ggpht.com/_HAZjMzZWrtc/S05qkb7KkYI/AAAAAAAABCw/oPJ80XXYH-Y/d/_GOR3359.JPG
Comment 3 Marcel Wiesweg 2010-01-18 22:28:57 UTC
So far I have been provided with test images, all of which use a more traditional way of defining color space (simple tags, usually only sRGB or AdobeRGB). You are the first one to mention this DCF spec here, which should explain why it's not supported.

If the spec PDF is not available, can information be found anywhere about the tags relevant for color management?
Comment 4 Frank Gore 2010-01-19 00:24:24 UTC
I've found a PDF document that outlines the relevant changes in DCF 2.0 (as opposed to 1.0), but it doesn't go into detail. It can be found here:
http://www.cipa.jp/exifprint/contents_e/01exif_e/ExifDCFsummary_E.pdf

I also have a copy of the full DCF 2.0 specification here as a PDF, but I'm no expert on copyright and stuff. I don't know if I can redistribute it. I found it laying around on the web, I didn't purchase it or anything. It says:

© 2002 by the Japan Electronics & Information Technology Industries Association All rights reserved. No
part of this standard may be reproduced in any form or by any means without prior permission in writing
from the publisher.

Nothing there about giving the PDF file to someone else... but just about anyone can find it by typing "DCF 2.0" in google and looking at one of the top 5 results.
Comment 5 Marcel Wiesweg 2010-01-20 19:45:24 UTC
Thanks, I got it.
I will have a look at this, not immediately, but keep it on my TODO list for after 1.1
Comment 6 Marcel Wiesweg 2012-03-12 11:04:22 UTC
I downloaded the two sample files, sRGB and AdobeRGB are properly detected. Please reopen if you have files where this is not the case with recent versions of digikam and Exiv2.