darktable-org / darktable-org/rawspeed
Samsung NX11 SRW black point inaccuracy
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 456
- Forks
- 147
- PR merge metrics
- No merged PRs in 30d
Description
Observed behavior:
I've noticed that high ISO (>=800) SRW images from my NX11 gain a red tint when imported into darktable. Through closer inspection, I determined that the raw black / white point module was receiving incorrect black levels.
In darktable:
- File _0285.SRW, ISO 400, shutter 1/40 has black levels set to
5 5 7 7. - File _0287.SRW, ISO 800, shutter 1/160 has the levels set to
24 24 0 0.
This results in _0287.SRW gaining a red tint. Setting the black levels based on exiftool's WB_RGGBLevelsBlack results in a much more color-accurate image, very similar in appearance to (if not the same as) the camera's preview.
For comparison, here are the levels read by exiftool:
$ exiftool -ISO -Samsung:WB_RGGBLevelsBlack _SAM0285.SRW
ISO : 400
WB RGGB Levels Black : 2 2 2 2
$ exiftool -ISO -Samsung:WB_RGGBLevelsBlack _SAM0287.SRW
ISO : 800
WB RGGB Levels Black : 14 13 13 14
The NX11 definition in cameras.xml:
<Camera make="SAMSUNG" model="NX11">
<ID make="Samsung" model="NX11">Samsung NX11</ID>
<CFA width="2" height="2">
<Color x="0" y="0">BLUE</Color>
<Color x="1" y="0">GREEN</Color>
<Color x="0" y="1">GREEN</Color>
<Color x="1" y="1">RED</Color>
</CFA>
<Crop x="17" y="8" width="4602" height="3068"/>
<Sensor black="0" white="4095"/>
<BlackAreas>
<Vertical x="0" width="8"/>
</BlackAreas>
<ColorMatrices>
<ColorMatrix planes="3">
<ColorMatrixRow plane="0">10332 -3234 -1168</ColorMatrixRow>
<ColorMatrixRow plane="1">-6111 14639 1520</ColorMatrixRow>
<ColorMatrixRow plane="2">-1352 2647 8331</ColorMatrixRow>
</ColorMatrix>
</ColorMatrices>
</Camera>
_SAM0287.SRW with levels 14 13 13 14 (exiftool), color correct
_SAM0287.SRW with levels 24 24 0 0 (rawspeed), visible red tint
Expected behavior:
Black levels should match the camera’s calibration, as stored in WB_RGGBLevelsBlack.
Steps to reproduce:
- Obtain SRW files from a Samsung NX11 shot at different ISOs.
- Open them in darktable with default settings.
- Inspect the “raw black/white point” module: note the per‑channel black levels.
- Compare with
exiftool -Samsung:WB_RGGBLevelsBlack
Environment:
darktable version: 5.4.1
OS: Fedora Linux 44 (KDE Plasma Desktop Edition) x86_64
Kernel: Linux 7.1.9-200.fc44.x86_64
Sample files: https://drive.proton.me/urls/8DNJB9MK1R#Tmgm7FfR51jg
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Samsung NX11 entry in cameras.xml and inspect how the raw black/white point module obtains its per-channel levels for the supplied SRW files. Use the ISO 400 and ISO 800 samples with exiftool -Samsung:WB_RGGBLevelsBlack, then verify that darktable receives matching levels and no longer shows the red tint.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, xml
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100