But what I'm still struggling with - and I haven't seen a simple answer (perhaps there is no such thing) - if we start with 12 bit data and end-up with 15 or 16 bit data, what are all those intervening levels: zeros or interpolations? Because no matter what the gymnastics, there are *only* 4096 levels of original information.

And secondly, what are the implications for drawing Curves or making HSB adjustments that so much of the data is zeros or interpolation?

[a href=\"index.php?act=findpost&pid=130263\"][{POST_SNAPBACK}][/a]

Luckily the answer is simple: all those thounsands of levels that "should not" be there, as the original range provides a maximimum of 4096 different levels, are just

**interpolated**.

Look at this, it's a real histogram where each X-axis value corresponds to a value in the 0..65535 range (that is why 0..767 values are represented as the plot is 768 pixels wide):

[span style=\'font-size:8pt;line-height:100%\'](

**NOTE**: for simplicity this is the histogram of only the blue channel.

Two blue types were used to distinguish levels according to their origin)[/span]

- In dark blue the captured levels are represented, i.e. those levels captured by your sensor and that were given a value chosen between only 4096 possible values. They appear now equally spaced as to arrange the original 0..4095 range into the 0..65535 range the raw developer had first to spread them along the range, i.e. multiply them by a factor. So between each pair of captured values a lot of zeroes appeared at the first stage but...

- We only know (RGBG Bayer matrix) one of every three values we need to complete the image information, so we need to interpolate the unknown values. And it's after applying this interpolation algorithm to find out the unknown information when all levels until now set to zero in the histogram get filled with interpolated values, presented in cyan blue.

I will show you a numerical example of the process: imagine that you have one pixel with a captured value B=4000. Next to it a pixel of unknown B value according to the Bayer matrix so we will have to interpolate it. And the the third pixel has a value B=4001.

4000,???,4001

If we would represent the histogram at this point, a continuous histogram in the 0..4095 range would appear.

They are 12 bit numbers in the 0..4095 range, ok? now we are going to develop that RAW file. First we scale the RAW data from 12 bit to 16 bit range, i.e. multiply by 2^4=16.

4000*16 -> 64000

4001*16 -> 64016

Our image becomes now

64000,???,64016

If we would represent the histogram at this point, a non continuous histogram in the 0..65535 range would appear, with equally spaced levels separated by 15 zeros in the spaces between.

Now we apply the interpolation algorithm: to calculate the middle pixel blue value we work out the mean: (64000+64016)/2=64008

The final image is:

64000,64008,64016

Repeating the interpolation process for all unknown pixels, statistically all zeroes will be filled with some values so a continuous histogram in the 0..65535 range would appear, but showing peaks (captured) and valleys (interpolated).

Is that clear now?

______________________

regarding the application of curves to the interpolated data, is no problem at all. The editing tools that you may use will not distinguish which is the origin of a given value, they will simply have a bunch of pixels with 3 RGB values each, and operate them without caring about their origin.

The fact that the original image was only 4096 possible levels but the interpolated values are 65536 possible levels, adds a lot of tone richness to our image that will resist now stronger processings thanks to the new set of possible values provided by the interpolation.