for details on tonal quality, dynamic range and digital see
here
RAW files can be converted to either 8 bit JPEG or TIFF files, or to keep as much information as possible, to 16 bit TIFF.
note that jpeg files are only 8 bit so you have lost range by converting to jpeg.
8 bits mean that the data per color channel for each pixel can have a value within the range of 0 to 255.
if one uses a linear 8-bit image file (ie. gamma = 1 such that data spread is even for each part of the exposure range) then to fit a dynamic range of 8EV equally, each 1EV in dynamic range would only have 256/8 = 32 possible values per channel which would not give a sub-optimal image quality.
Gamma encoding spreads the data and shifts the results towards the more sensitive end of the human visual range. The stages are first to convert the analog signal to a 10-bit or higher internal values (depending on the hardware), then apply the gamma function to these values, before finally rounding down to 8-bits. This preserves much of the dynamic range, and minimises the perceptible quantisation errors in 8-bit values.
Thus if we look at the brightest 1EV exposure zone in an image, if it was shot in 12bit RAW using sRGB color space, this zone would have available to it 2048 brightness levels per channel, when this is directly converted to a 8-bit jpeg, this same exposure zone has those 2048 levels squeezed into only 69 levels.
If we look at the exposure zone 3 stops down from the brightest, and thus closer to skin tones, in 12bit RAW there are 512 levels which are squeezed into only 37 levels in an 8-bit jpeg.
if we under-exposed our skin tones by 2 stops, we would have only 128 levels in RAW which are squeezed into a measly 20 levels in jpeg with resultant marked loss of tonal range - what could have been 512 levels of tonal range has been converted to only 20!!
THUS GENERAL RULES OF DIGITAL FOR GOOD SKIN TONAL RANGE: