Bug 207005 - Raw Import Tool does not reflect the predefined Workspace when custom camera profile is chosen
Summary: Raw Import Tool does not reflect the predefined Workspace when custom camera ...
Status: RESOLVED WORKSFORME
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-RawImport-Native (show other bugs)
Version: 1.0.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-10 23:19 UTC by Milan Knížek
Modified: 2022-01-26 04:23 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 3.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milan Knížek 2009-09-10 23:19:20 UTC
Version:           digikam 1.0.0 beta5 svn (using KDE 4.3.1)
OS:                Linux
Installed from:    Compiled From Sources

digiKam's Raw Import Tool does not reflect the predefined Workspace (Raw, Adobe RGB, Wide Gamut, Pro-Photo) when a custom camera profile is chosen. Instead, the colour transform is always the same: from the custom camera profile to sRGB.

When the user selects manually the Workspace profile, the colour transform works as expected.

I guess the reason is explained in dcraw man page:
...
       -p camera.icm [ -o output.icm ]
              Use ICC profiles to define the camera’s raw colorspace and the desired output colorspace (sRGB by default).
       -o [0-5]
              Select the output colorspace when the -p option is not used:

                   0   Raw color (unique to each camera)
                   1   sRGB D65 (default)
                   2   Adobe RGB (1998) D65
                   3   Wide Gamut RGB D65
                   4   Kodak ProPhoto RGB D65
                   5   XYZ
...
Hence, when a custom camera profile is selected, the -o [0-5] are ignored and a real ICC profile is expected. If not provided, the transform is done to sRGB.

Proposed solution:
When the user chooses "Custom" camera profile, the Workspace should offer only sRGB and Custom.
Alternatively, digiKam should silently replace the internal profiles with a real ICC profile of the respective name (could there be a problem with copyright for their distribution?)
Comment 1 Milan Knížek 2009-09-10 23:33:24 UTC
I can provide a detailed test case, if needed. Tested with libkdcraw 0.5.0.

To reproduce the bug:

1. Disable colour management in digiKam's Settings to see the actual colours
without another transform to the display colour space.

2. Grab some raw file and open it in Raw Import Tool (edit).

3. In the Colour Management tab, select "Custom" camera profile and load
sRGB.icc from the disk.

4. Set the Workspace profile to "Raw" and click update.

5. Set the Workspace profile to any other from the predefined list (but Custom)
and update the preview. The image colours are always the same, but should not
be.

6. Set the Workspace profile to "Custom", load some other profile
(ProPhotoRGB.icc) from the disk and update. The image colours change.

7. Set the Workspace profile to the predefined "Pro-Photo" and update, the
image colours change, but should stay the same (provided that the "Pro-Photo"
is equal to ProPhotoRGB.icc).
Comment 2 Marcel Wiesweg 2009-09-11 14:19:52 UTC
Firstly, I could not change this part of color management settings so far because it's in libkdcraw. I think this should be completely integrated with digikam's color management settings.

Is there a difference between selecting a camera profile + workspace profile in
the raw settings vs. getting the image in RAW color space and setting an input profile (+converting to workspace profile) in digikam?

I have tried to specify a custom output profile only, but that doesn't work and this may explain it: defining a custom output profile is only supported if a custom input profile is given...
Comment 3 Milan Knížek 2009-09-11 19:43:29 UTC
(In reply to comment #2)
> I have tried to specify a custom output profile only, but that doesn't work and
> this may explain it: defining a custom output profile is only supported if a
> custom input profile is given...

I cannot confirm this part - selecting Camera as "None" and then switching Workspace "raw|sRGB|...|Pro-Photo|Custom1|Custom2|..." changes the image colours as I would expect.
Manually choosing sRGB.icm as "Custom" and then switching to "sRGB" does not make any difference - as expected.
(I have colour management off to see what happens with the image.)
Comment 4 Marcel Wiesweg 2009-09-11 20:53:35 UTC
Regardless of these problems here, bugs and implementation difficulties - what about
1) If color management is off, always load RAWs in sRGB, and hide color management settings
2) If color management is on, use digikam's color management settings:
a) If user chose automatic colors / no input profile available, convert to workspace profile
b) If user specifies an input profile, apply it and convert to workspace profile
Comment 5 Milan Knížek 2009-09-11 22:48:27 UTC
(In reply to comment #4)
> Regardless of these problems here, bugs and implementation difficulties - what
> about
> 1) If color management is off, always load RAWs in sRGB, and hide color
> management settings
This looks fine.

> 2) If color management is on, use digikam's color management settings:
> a) If user chose automatic colors / no input profile available, convert to
> workspace profile
> b) If user specifies an input profile, apply it and convert to workspace
> profile
This may be fine for majority of users, but complicated for others.

Majority of my images in my albums are in sRGB (JPEGs from small cameras, final images for web publishing), hence I use sRGB as the workspace.

Then I have few images in AdobeRGB (those for printing). I do not mind digiKam editor asking me what to do on profile mismatch (AdobeRGB vs sRGB, of course I keep the embedded), since there are just a few of such images.

But this means that if I want to convert a raw image to AdobeRGB, I would have to change the workspace beforehand. Clumsy.

P.S. It just comes to my mind - what about adding another option to CM Settings re. the profile mismatch. Now there is "Ask..." and "Convert to workspace...", the one missing is "Keep embedded...". The last default option would solve the above trouble - I could set AdobeRGB as workspace and digiKam would not ask me for every sRGB image "what to do...".
Comment 6 Marcel Wiesweg 2012-09-29 12:02:27 UTC
In current code, we work around the problem (-o <filepath> being ignored unless -i <filepath> is used) by requesting wide-gamut output from libraw and converting afterwards in digikam. I guess the bug should be solved. Reopen if there are still problems with recent (3.0) versions