Bit Depth of Raw Converter

Moderator: jsachs

Robert Schleif
Posts: 340
Joined: May 1st, 2009, 8:28 pm

Bit Depth of Raw Converter

Post by Robert Schleif »

Although my camera supposedly uses a 12 bit converter, I have been unable to see any more than 8 bits of information present in the 48 bit (3 x 16) tiff files resulting from converting a raw file. That is, in each channel (RGB), information other than zeros is present only in the top 8 bits of the 16 bits that could carry image information. I find this no matter how I set the dynamic range sliders or the exposure slider. Do I have a wrong setting somewhere or am I not using the raw converter correctly, or is it only an 8 bit converter?
The way I test for information in the lower 8 bits is to apply a Brightness Curve transformation (0, 0; 1,255; 255,255), call it a brightening transformation because it brightens by a factor of 255. This should convert all image information in the top 8 bits to pure white or pure black, and move the information in the bottom 8 bits to the top 8 bits where it should be visible. (A way to test this operation and that the 16 bit image files are working correctly is to do the following: mask half of a normal 16 bit image, apply the following Brightness Curve transformation to the masked area, (0,0; 255, 1), call it a dimming transformation because it reduces brightness to 1/255 of the original. This will leave the masked area looking black. Then apply the brightening transformation to the entire image. The masked area should now display the original image whereas the unmasked area should be pure white and pure black. The brightening and dimming transformations are best done by loading the appropriate *.crv files that have been created by a text editor.
jsachs
Posts: 4210
Joined: January 22nd, 2009, 11:03 pm

Re: Bit Depth of Raw Converter

Post by jsachs »

I'm not sure the method you are using to check the low order bits is reliable. You might try extracting one of the RGB channels from the image and then using the Window/Count Colors command. If it shows more than 256 colors then there is more than 8 bits of information in the channel.
Jonathan Sachs
Digital Light & Color
Robert Schleif
Posts: 340
Joined: May 1st, 2009, 8:28 pm

Re: Bit Depth of Raw Converter

Post by Robert Schleif »

Using count colors is certainly elegant but since it doesn't currently work on files with 16 bit depth, (see the posts on Count Colors Not Working on 16 and 48 bit files), the dimming and brightening transformations may be the easiest way at present to check the output range of the raw converter. Does anyone have a raw file and converter settings that will generate an output file with image information in more than the top 8 bits of a channel?
Dieter Mayr
Posts: 453
Joined: April 24th, 2009, 11:47 am
What is the make/model of your primary camera?: Nikon D700
Location: Salzburg / Austria

Re: Bit Depth of Raw Converter

Post by Dieter Mayr »

Robert

I am reading your post for sure the tenth time, and i still do not understand what you mean.
If I take a converted RAW from my Fuji S3 (also 12 bit depth internal) and check the image with the Readout tool, I get values like
9411 / 5DA9 / 2928 (RGB Values in HEX), so all have the lowest 8 bit set with a value other the 0.
If it would not be, and all values would be in the upper 8 bit, there would be no brightness values below 50%, so the image would be far to bright (overxposed, so to say).
But maybe I understand you completely wrong.
Dieter Mayr
jsachs
Posts: 4210
Joined: January 22nd, 2009, 11:03 pm

Re: Bit Depth of Raw Converter

Post by jsachs »

If all the values were in the upper 8 bits this does not mean that there would be no brightness levels below 50%, just that there are gaps between each brightness level. Using the readout tool however is a great way to see what is in the low order bits.
Jonathan Sachs
Digital Light & Color
Dieter Mayr
Posts: 453
Joined: April 24th, 2009, 11:47 am
What is the make/model of your primary camera?: Nikon D700
Location: Salzburg / Austria

Re: Bit Depth of Raw Converter

Post by Dieter Mayr »

Thanks Jonathan.

Just to see if i understood correct:
A 16 bit image has 256 times aus much levels then a 8 bit image has.
So a value 1 from a 8 bit image would convert to 0100 in 16 bit (or maybe 00FF ?)
value 2 in 0200 (or 01FF ?) and so on till 8 bit value FF to 16 bit value FFFF.
Did i understand correctly ?
So if the lower 9 bits are either all 0 or all 1 (depending on the conversion) there are just 256 levels in the image, if there is a change in the last 2 digits, it is a "real" 16 bit image.

But i have made a short test and this seems to show me that i did not understand correctly.
I created a new image, 256 pixel wide, 8 bit black and white, created a linear gradient from black to white, so every pixel row of the image has a single value from 00 to FF.
Then converting to 16 bit and using the Readout tool with a probe size of 1x1 give values like 5D5D or C7C7, so the lower 8 bit mirror the upper 8 bits.
What happens here ?
Dieter Mayr
jsachs
Posts: 4210
Joined: January 22nd, 2009, 11:03 pm

Re: Bit Depth of Raw Converter

Post by jsachs »

As I mentioned in an earlier post, in PWP conversion from 8-bit to 16-bit is not done by simply shifting the bits left and setting all the low order bits to zero. Conversion is done by rounding to the nearest 16-bit level using the formula: v16 = (65535*v8 + 127)/255. Regardless, there are only 256 distinct levels in a 16-bit image converted from an 8-bit image which is why the count colors command would work if it weren't disabled in the current version.

>> So if the lower 9 bits are either all 0 or all 1 (depending on the conversion) there are just 256 levels in the image.

If the lower 9 bits were all 0 there would be 128 levels, not 256.
Jonathan Sachs
Digital Light & Color
Dieter Mayr
Posts: 453
Joined: April 24th, 2009, 11:47 am
What is the make/model of your primary camera?: Nikon D700
Location: Salzburg / Austria

Re: Bit Depth of Raw Converter

Post by Dieter Mayr »

Thanks for the explanation, Jonathan
The 9 bits were misstyped, should have been 8 bits for 256 values, sorry for it.
Dieter Mayr
Robert Schleif
Posts: 340
Joined: May 1st, 2009, 8:28 pm

Re: Bit Depth of Raw Converter

Post by Robert Schleif »

Indeed, the readout tool is another way to examine the bit depth of images, although if you zoom in so that you can be sure you are not skipping any neighboring pixels, it is a bit laborious to look through an image.
Jonathan's conversion algorithm is very close to being shift left 8 places and fill with zeros. Perhaps it can be described as shift left 7 1/2 places?
Using the readout tool I have not yet been able to find evidence that the raw conversion tool operating on my camera's raw files is generating images with a bit depth greater than 8 (That is, in the 16 bit tiff images, the lowest nonzero value I can find with the readout tool is greater than 256.) I'd still like to know whether it is my camera, the settings of the converter, or a limitation of the raw converter.
Dieter Mayr
Posts: 453
Joined: April 24th, 2009, 11:47 am
What is the make/model of your primary camera?: Nikon D700
Location: Salzburg / Austria

Re: Bit Depth of Raw Converter

Post by Dieter Mayr »

This image is converted from a RAW file of a Fuji S3, and measuremet is done with a probe size 1x1, to measure exact 1 pixel.
Unitres mesured are Decimal values of pixels (so, going from 0 to 65535).
The measurement is taken in the very deep shadow area.+
16_Bit_RAF.JPG
16_Bit_RAF.JPG (24.27 KiB) Viewed 5925 times
Hope it helps you
Dieter Mayr
Post Reply