Add new comment

Questions about black-level and white-levels in colordata

Hi,
I had posted a question about this yesterday, but I dont think that post was well-researched (my bad!). I am reposting after doing some digging around myself. Hopefully these questions are a little more pointed.

The comments that I am specifying below is after calling unpack(). I am trying to use libraw to read the CFA data and all metadata to build my own RAW processing pipeline. Hence, I am using libraw primarily to read the data.

1. Is the correct way to determine the black-level per channel to do black + cblack as one defines the baseline and cblack contains the corrections?

2. I noticed that Fuji X-trans and some DNG files define black-level over a region. Is this what is captured in the cblack[4] and cblack[5]? For a Fuji X-trans file in my test files, cblack[4] = cblack[5] = 6. The values from cblack[6] -> cblack[41] were 256. The black property was 0. Does it mean the black-level to use is actually 256? Similar for some DNG files, the values of cblack[4] and cblack[5] were 2.

3. Is it fair to say that cblack is meant to handle the two ways black-level is specified for different RAW files? When cblack[4] and cblack[5] is 0, is it fair to assume that cblack[0] -> cblack[3] values are to be taken as the per channel correction. And when cblack[4] and cblack[5] is non-zero, then you must use a repeated pattern of this region starting at the top-left of the visible area? Also what is the order or cblack[0...3] i.e. are they R G1 B G2 order or the Bayer pattern order?

4. Is the value of maximum the white-level or saturation? This seems to hold for DNG files and the WhiteLevel tag. Is maximum or linear_max more reliable? I was not clear what the comment about black-level not being subtracted when linear_max is not available meant.

Regards,
Dinesh

Forums: