Skip to content

Read the black level recorded by the camera - #18

Merged
sputier merged 1 commit into
mainfrom
feature/black-level
Nov 19, 2026
Merged

sputier merged 1 commit into
mainfrom
feature/black-level

Conversation

@sputier

@sputier sputier commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Adds RawBlackLevel (one value per photosite of the 2 x 2 pattern, with At(column, row)), exposed by RawMetadata.BlackLevel and RawImage.BlackLevel. It comes from the Nikon MakerNote (tag 0x3D) and is not subtracted from the samples.

  • It is read only for a red, green, green, blue pattern and 14 bit samples, the layout checked on camera files; for another pattern or depth the order of the values and their scale are not established, so the value is null rather than possibly wrong.
  • A missing record, a record that does not hold four values, or a value that does not fit the samples gives null.
  • Checked on 570 real files of a Nikon Z 6 (present, in range) and with synthetic files (both byte orders, patterns, depths, hostile values).

Part of #6.

RawMetadata.BlackLevel and RawImage.BlackLevel give the level of each of the four
photosites of the colour filter pattern. It is read for the layout checked on camera
files (red, green, green, blue pattern, 14 bit samples) and is null otherwise.
@sputier
sputier merged commit 9960e6b into main Nov 19, 2026
4 checks passed
@sputier
sputier deleted the feature/black-level branch November 19, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant