Bug 356975 - Nikon 5300 12bit RAW/NEF: wrong white/black level
Summary: Nikon 5300 12bit RAW/NEF: wrong white/black level
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Plugin-DImg-RAW (show other bugs)
Version: 4.12.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL: http://jonas.freesources.org/digikam/...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-20 23:50 UTC by Jonas Meurer
Modified: 2017-07-31 15:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonas Meurer 2015-12-20 23:50:21 UTC
Hi,

apparently, digikam sets wrong white/black levels for 12bit RAW/NEF images from Nikon D5300. Colors are not the same as in the jpg preview at all. Instead, a dark, green version of the picture is shown. After some research, I found out that rawtherapee has the same problem. See the following bugreports and forum posts for more details:

https://code.google.com/p/rawtherapee/issues/detail?id=2569#c1
http://rawtherapee.com/forum/viewtopic.php?f=3&t=5406

The linked comment of issue #2569 provides a workaround for rawtherapee: Set the RAW black points for all three color channels to '-450' and white-point correction for RAW white points to '4.00'. Indeed, this works as expected in rawtherapee.

Unfortunately I don't find corresponding settings in the digikam editor. If they do exist, can you point me to them?


Reproducible: Always

Steps to Reproduce:
1. Make a 12bit RAW/NEF picture with Nikon D5300 or fetch the example picture from http://jonas.freesources.org/digikam/DSC_0542.NEF
2. Import this picture into digikam. The preview looks correct as the jpg preview is used.
3. Open the picture in the editor. For me, it looks like the following: http://jonas.freesources.org/digikam/DSC_0542.jpg

Actual Results:  
The picture is displayed with wrong colors (wrong black points/white points settings).

Expected Results:  
Correct black points/white points should be set for Nikon D5300 12bit RAW/NEF pictures.
Comment 1 Philip Johnsson 2015-12-21 01:26:01 UTC
I would try to update Libraw to version 0.17 that have bug fixes that might help with your problem. I'm thinking of this in the changelog:

"Many improvements in data decoding/processing:
    *Correct decoding of black level values from metadata for many formats, LibRaw do not rely on hardcoded black levels. "

libkdcraw needs to be rebuilt against it for Digikam to use the updated libraw.
Comment 2 Jonas Meurer 2015-12-21 09:36:44 UTC
Thanks Philip, thanks for the hint. Indeed, using libraw15 fixed the issue for me. On Ubuntu Wily it was as easy as installing the libraw15[1], libkdcraw23[2] and libkdcraw-data[3] packages from Ubuntu Xenial. Fortunately, none of these library packages indroduced further dependencies on Xenial packages yet.

Closing the bugreport as resolved/invalid as it is not a bug in digikam.

Philip, maybe you can upload libraw15 and rebuilt libkdcraw23 packages to ppa:philip5/extra[4]?

[1] http://packages.ubuntu.com/xenial/libraw15
[2] http://packages.ubuntu.com/xenial/libkdcraw23
[3] http://packages.ubuntu.com/xenial/libkdcraw-data
[4] https://launchpad.net/~philip5/+archive/ubuntu/extra
Comment 3 caulier.gilles 2015-12-21 14:00:18 UTC
Jonas,

I tested with 5.0.0 and all work fine as Libraw 0.17.1 is included in core (i will update to 0.18.0 in January 2016)

https://www.flickr.com/photos/digikam/23805594731/in/dateposted-public/

I close the file as resolved with fixed in 5.0.0, as this version do not use libkdcraw anymore.

Gilles Caulier

PS : where are you taken this picture. It look like south of France...
Comment 4 Jonas Meurer 2015-12-21 14:33:48 UTC
Hi Gilles,

thanks for pointing out that the bug is actually resolved *within* digikam 5.0.0. Looking forward to use it once released. For now, an updated libkdcraw that is built against libraw 0.17.1 works for me.

PS: the picture is taken in South Africa.
Comment 5 Philip Johnsson 2015-12-21 21:45:59 UTC
Jonas,

Yes I can look into updating libraw in my PPA but it have to be after the christmas holidays when I have more time.