mr.adams.RemoveThis@gmx.net wrote:
>David J Taylor schrieb:
>> The ADC should linearly convert light levels from the sensor to digital
>> values, yes, and the accuracy depends on the number of bits. However
>> general photographic usage talks in terms of "stops" which are not a
>> linear scale, but a logarithmic one (corresponding more closely to how the
>> eye responds to light). Alternatively, you could look on it as a
>> percantage accuracy. With a linear conversion, the quantisation step
>> expressed as a fraction of the signal in a 256-level signal is 1/256 at
>> the white end, but "100%" at the black end (1/1). With a gamma-corrected
>> JPEG, the percentage steps are more equal across the whole range.
>> Does that help?
>
>Not really because I still do not see why it should compress the
>dynamic range in the picture. In a 256-level signal the spot at 1/256
>represents the brightest part of the image and 1/1 the darkest. The
>logarithmic range in between can well be 10 stops, itīs only that I
>have just 8 different values to represent them. But: The spot at 1/256
>is still 10 stops brighter than at 1/1 or am I on the totally wrong
>track here?
With a "linear" conversion, the number of bits determines the
ratio of the maximum level to the minimum level that can be
recorded, and that is of course the dynamic range.
Your statement is true for what is called a "non-linear" A-D
conversion. The 8-bit representation used by JPEG is an example
of exactly that. The non-linear transfer function determines
the "dynamic range".
A significant point to remember though, is that "dynamic range"
does not necessarily equate to the same thing as "useful dynamic
range". Hence while it is true that JPEG technically can record
a greater dynamic range in 8 bits that a linear 12 bit file can,
there is a very significant difference between them, and the
_useful_ dynamic range of the 12 bit linear file is greater.
Here is a chart showing the "normalized" values for 12 bit linear
data:
| Number of | |
| Levels | |
Fstop | 12 bit | Normalized Pixel |
Range | Linear | value |
------|------------|------------------|
1 | 2048 | 1.0 |
2 | 1024 | 0.5 |
3 | 512 | 0.25 |
4 | 256 | 0.125 |
5 | 128 | 0.0625 |
6 | 64 | 0.03125 |
7 | 32 | 0.015625 |
8 | 16 | 0.007812 |
9 | 8 | 0.003906 |
10 | 4 | 0.001953 |
11 | 2 | 0.0009765 |
12 | 1 | 0.0004883 |
The brightest level would be 1.0, represented by a binary value
of 1111 1111 1111. Half that brightness would be 0.5,
represented by a binary value of 0111 1111 1111. One quarter of
the maximum brightness, 0.25, would be represented by 0011 1111
1111.
The range above 0.5 all the way to 1.0 is divided into 0111 1111
1111 equal parts, which in decimal is 2048 levels. Hence the
accuracy with which a brightness value in the highest f/stop can
be recorded is extremely good. (Probably more than 10 or 20
times better than the eye can distinquish, and hence using 2048
levels to represent only a 1 f/stop range is a real waste.)
Down at the 9th f/stop, the range is divided into 0000 0000 0111
values (decimal

, which is not particularly very good accuracy.
As it happens, 8 levels in an entire f/stop is just about the
minimum that is useful. Fewer than that and the image will
appear to be "posterized".
Hence even though a 12 bit file technically has a dynamic range
of 12 f/stops, the actualy useful dynamic range is about 9
f/stops.
However, with JPEG the increments are not linear (and there is
no waste of 2048 values just for 1 f/stop), and instead a "gamma
correction" curve is applied (basically that is a lookup table
which quantizes a larger number of values into a smaller number,
in a non-linear way). Here is the same chart as above, with
some extra columns showing JPEG data too:
+------- 12 bit linear -------+ +----------- 8 bit JPEG ------------+
/ \/ \
| No. Levels | Normalized Pixel | 8 bit | No. Levels |
Fstop | 12 bit | value | Gam.Cor. | 8 Bit JPEG |
Range | Linear | Linear * Gam.Cor. | Value | Gamma Corr |
------|------------|-------------*--------------|----------|------------|
1 | 2048 | 1.0 * 1.0 | 255 | 69 |
2 | 1024 | 0.5 * 0.72974 | 186 | 50 |
3 | 512 | 0.25 * 0.53252 | 136 | 37 |
4 | 256 | 0.125 * 0.38860 | 99 | 27 |
5 | 128 | 0.0625 * 0.28358 | 72 | 20 |
6 | 64 | 0.03125 * 0.20694 | 53 | 14 |
7 | 32 | 0.015625 * 0.15101 | 38 | 10 |
8 | 16 | 0.007812 * 0.11020 | 28 | 8 |
9 | 8 | 0.003906 * 0.08042 | 21 | 6 |
10 | 4 | 0.001953 * 0.05868 | 15 | 4 |
11 | 2 | 0.0009765 * 0.04282 | 11 | 3 |
12 | 1 | 0.0004883 * 0.03125 | 8 | 2 |
13 | | 0.0002415 * 0.02269 | 6 | 2 |
14 | | 0.0001207 * 0.01656 | 4 | 1 |
15 | | 0.0000604 * 0.01208 | 3 | 1 |
16 | | 0.0000302 * 0.00882 | 2 | 0 |
17 | | 0.0000151 * 0.06434 | 2 | 1 |
18 | | 0.0000075 * 0.00470 | 1 | 1 |
19 | | 0.0000038 * 0.00343 | 1 | 0 |
Some want to claim that the above means that 8 bit gamma
corrected JPEG data can represent a dynamic range of 19 f/stops!
Technically that appears to be true, but obviously none of the
f/stops below the 8th one are of any usefulness, since those all
have fewer than 8 values per fstop.
For all practical purposes, the lowest 15 values in a 12 bit
linear file are of no significance and the lowest 21 values in a
JPEG file are equally useless. A 12-bit linear file can retain
a 9 f/stop dynamic range. A JPEG gamma correctd file can retain
8 f/stops of dynamic range.
--
Floyd L. Davidson <http://www.apaflo.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska) floyd.RemoveThis@apaflo.com
>> Stay informed about: dynamic range and A/D conversion