PDA

View Full Version : 8 bit linear value conversion to Log Density? FILM

w5ami
23-Jun-2014, 09:03
I am new on this forum, and glad to find it. I would like to know if anyone has found a suitable forumla to approximate a conversion from 8 bit gray shade values (0 - 255) to log denisty, e.g. 0.0 - 2.4, or 0 to 3.0? My math used to be pretty good, but with age, my mind doesn't work the way it used to. I realize the conversion will most likely be approximate. I have a densitometer, so this is more out of curiousity than anything... Thanks!

Brian

Nathan Potter
23-Jun-2014, 12:58
Well I don't have a formula but the conversion is about linear (of course) on a log/log plot as shown in a home made plot below. For that plot I used a Stouffer step wedge on a scanner then determined the 0 to 256 equivalent using a K density value on a Photoshop image of the scanner step wedge. Roundabout method but may be more or less OK for what you want.

https://farm6.staticflickr.com/5077/14305004579_70dcf14d65_c.jpg (https://www.flickr.com/photos/argiolus/14305004579/)
STEPplot-1-WEDGE-D-vs-EPSON (https://www.flickr.com/photos/argiolus/14305004579/) by hypolimnas (https://www.flickr.com/people/argiolus/), on Flickr

Nate Potter, Austin TX.

Leigh
23-Jun-2014, 13:38
Nice graph, Nate.

One nitpicky comment...
As presented, your density range is 1 to 256, not 0 to 256.

- Leigh

w5ami
23-Jun-2014, 15:58
Well I don't have a formula but the conversion is about linear (of course) on a log/log plot as shown in a home made plot below. For that plot I used a Stouffer step wedge on a scanner then determined the 0 to 256 equivalent using a K density value on a Photoshop image of the scanner step wedge. Roundabout method but may be more or less OK for what you want.

https://farm6.staticflickr.com/5077/14305004579_70dcf14d65_c.jpg (https://www.flickr.com/photos/argiolus/14305004579/)
STEPplot-1-WEDGE-D-vs-EPSON (https://www.flickr.com/photos/argiolus/14305004579/) by hypolimnas (https://www.flickr.com/people/argiolus/), on Flickr

Nate Potter, Austin TX.

Nate, that will help, and thanks for taking the time to do that. Only thing is, on GIMP in the "curves", the low density (blacker) values are lower numbers, and they increase as the image area increase in brightness. For example, Zone I looks to be about 28 or so, and Zone X would be 255. I can make what you've done work however. Thanks!

Brian

Leigh
23-Jun-2014, 16:45
on GIMP in the "curves", the low density (blacker) values are lower numbers, and they increase as the image area increase in brightness.
That's correct, and conforms to the actual values seen by the electronic components.
0 = solid black, 255 = solid white.

- Leigh

onnect17
25-Jun-2014, 12:25
Brian,
The fact you have the question is enough to know that your math is pretty good.
I do not think the conversion itself is as linear as many members expressed. You approach show be logical first. How can you represent a range of densities maintaining the gray point at the center of the range?

I usually address the issue using normalization, which allows you to keep the gray point in the center of the scale, regardless of the range of densities.
The equation is quite simple, typical f(x)=a^x, with a <= 1.

If you center is 18% gray or approximately .745 density (D), then f(D)=MAX_VAL * (0.395)^D

For example, for 8 bits --> f(0.745)=255 *(0.395)^0.745 = 255 * 0.5006 = 127.5

ic-racer
25-Jun-2014, 16:58
There no generic conversion without assigning the 255 to some fixed density. What are you trying to accomplish?

Leigh
25-Jun-2014, 17:21
There no generic conversion without assigning the 255 to some fixed density.
Not sure what you mean.

You can assign any one binary value (output of the A/D) to any quantity received from the sensor.

The other 255 values are fixed ratios of 2 from that assigned value. No error or exception to that.
Of course that assumes the A/D is of decent quality with monotonic output, as most modern ones are.

- Leigh

onnect17
25-Jun-2014, 19:43
There no generic conversion without assigning the 255 to some fixed density. What are you trying to accomplish?

The 255 is the "zero" density. How "zero" is defined depends on the hardware. Some scanners will do a pre-scan and set it via DACs. Others will have a little window off the scanning area to set it. In the case of film the zero should be the base + fog so I save a piece of the emulsion and place it in "zeroing" area.

Most table densitometers without light source have a way (typically a wheel) to "zero" the density.

Regarding the Epson or any other CCD based scanner, specially those using diffused light sources. They could give you an idea of the densities but sure will not replace a real densitometer.

ic-racer
26-Jun-2014, 04:26
The 255 is the "zero" density.

There is no a priori relation between the two. That is an arbitrary assignment.

Leigh
26-Jun-2014, 04:30
The 255 is the "zero" density.
There is no a priori relation between the two. That is an arbitrary assignment.
Assigning the highest intensity impinging on the sensor (i.e. zero density) to the 255 A/D output value is normal engineering practice.

I would expect that to be adjustable in most designs.

- Leigh

ic-racer
26-Jun-2014, 04:31
The other 255 values are fixed ratios of 2 from that assigned value.

They could be that or they could be any number of things that one might want them to be. There is not physical truth binding optical density to any particular numerical sequence.

Leigh
26-Jun-2014, 04:37
The other 255 values are fixed ratios of 2 from that assigned value.

They could be that or they could be any number of things that one might want them to be.
There is not physical truth binding optical density to any particular numerical sequence.
It appears you don't understand how an analog-to-digital (A/D) converter works.

Each value is related to adjacent values by a factor of two, exactly (at least theoretically).
That's the definition of a linear conversion function.

Devices that produce unique outputs when the inputs are varied by a factor of 2 are called "monotonic".
That's a desirable feature in commercial A/D converters, and is emphasized in their advertisements.

You can play with the design of the circuitry between the sensor and the A/D converter if you want some other conversion function, like logarithmic. But that's external to the A/D.

- Leigh

ic-racer
26-Jun-2014, 04:37
Assigning the highest intensity impinging on the sensor (i.e. zero density) to the 255 A/D output value is normal engineering practice.

I would expect that to be adjustable in most designs.

- Leigh

I'm not sure what you mean by that. What SENSOR?

Leigh
26-Jun-2014, 04:44
I'm not sure what you mean by that. What SENSOR?
The light coming through the film hits a photo detector of some sort. That's the sensor.

Your questions suggest that you know little or nothing about the design of electronic equipment.

- Leigh

Michael Rosenberg
26-Jun-2014, 16:51
I have a section in my digital negative monograph posted on my website where I discuss the digital zone system, and have a figure showing zones, %K and corresponding pigment values. This may be what you are after.

Regards,
Mike

Bill Burk
27-Jun-2014, 21:50
Mike,

How have you fared reading the densities of a negative using a scanner and how well did it correlate to the same negative read on a densitometer?

The problem I see is most scanners work to fit the range of the subject to nearly the entire positive scale 0-255, so a thin negative and a contrasty negative both give full-scale positive on-screen when the levels are adjusted. It's as if you had printed the thin neg on Grade 4 and the contrasty neg on Grade 2. But you know the densities of the two negatives aren't the same so there isn't a direct relationship from the 0-255 to a negative density from 0.00-3.00.

So to correlate a negative density to scanner result, you can scan a known grayscale and a test negative with the same parameters and compare different spots on both... There are probably other ways, and possibly some systems can directly provide a density reading.

But I don't see how you can directly relate 0-255 with 0.00 to 3.00 (or any other arbitrary density range) without some kind of calibrating.

Leigh
28-Jun-2014, 07:14
The problem I see is most scanners work to fit the range of the subject to nearly the entire positive scale 0-255, so a thin negative and a contrasty negative both give full-scale positive on-screen when the levels are adjusted. It's as if you had printed the thin neg on Grade 4 and the contrasty neg on Grade 2. But you know the densities of the two negatives aren't the same so there isn't a direct relationship from the 0-255 to a negative density from 0.00-3.00.
Bill,

You're assuming that the scanner is going to do scaling, which is a post-scanning step.

The (few) scanners that I've worked with operate in raw mode, with the software doing any post-scan scaling.

In raw mode you certainly can correlate a specific level to a specific density.
The density range depends on the hardware, and will will vary from one device to another.

- Leigh

w5ami
29-Jun-2014, 09:40
Bill,

You're assuming that the scanner is going to do scaling, which is a post-scanning step.

The (few) scanners that I've worked with operate in raw mode, with the software doing any post-scan scaling.

In raw mode you certainly can correlate a specific level to a specific density.
The density range depends on the hardware, and will will vary from one device to another.

- Leigh

Thanks for all the ideas and opinions. Yes, one must first develop a standard in how the film is "always" scanned, and that alone will take some calibration using a step wedge, etc. For this to work with any level of accuracy, the scanner must to set NOT to scale the dynamic range of the negative automatically. That would throw the entire process of this off. My scanner is calibrated manually, using manual settings of black point, white point, etc. Using the Zone system, which I do, a given "Zone" from negative to negative should produce similar results and density on the film. Of course film testing and development testing must be done prior to this. For example, the 8 bit value measured, of say 120 will always result in the same "Zone", and consequently, the same approximate film density, if it were measured on the densitometer. Regardless if you way overexposed or underexposed the film, there will be density, and they will fall into a certain zone, regardless if you intended them to or not! This idea assumes all other variables are accounted for, proper exposure, proper development, and proper scanner fixed calibration for all negatives, as it should be. My settings, would probably not work for someone elses negatives, as some people interpret zones slightly different. Using the aforemented math, it works for me just fine now. If your scanner can not be set to raw or manual control (or the software), this will not work!

Bill Burk
29-Jun-2014, 10:05
Great! I'm fortunate to use a real densitometer, and so I can verify (calibrate) what the scanner returns vs densities. Vue-Scan includes a densitometer tool that I occasionally experiment with but haven't calibrated yet.

Of course once you start watching your densities, you will start to see differences between what you expected and what you got.

Errors in exposure computation could cause all your Zones to fall on different densities than you expected (with no adverse impact on the "print-ability"). And flare totally plays havoc with where shadow Zone densities fall based on where you placed them (hopefully it improves them anyway).

Leigh
29-Jun-2014, 10:10
Yes, photography is a complex activity, even when considering only
the negative stage of the process, disregarding the printing phase.

There are many variables and options when discussing just the
design of the scanner hardware, disregarding the software entirely.

Thanks.

- Leigh

Leigh
29-Jun-2014, 10:14
Errors in exposure computation could cause all your Zones to fall on different densities than you expected...
Hi Bill,

You can also expect hardware variations to present themselves.

For example, the speed tolerance on modern Copal shutters is +/- 30%, which is more than 1/2 stop.

- Leigh

Bill Burk
29-Jun-2014, 10:47
Hi Bill,

You can also expect hardware variations to present themselves.

For example, the speed tolerance on modern Copal shutters is +/- 30%, which is more than 1/2 stop.

- Leigh

Leigh,

You are so right. Then you get into another whole set of experiments! I wanted to verify a camera's shutter speeds recently and tested three different factors: Time (electronic), Exposure (film densities) and Motion (turntable arc)... The different experiments didn't agree completely but they corroborated each other like three witnesses to a crime.

Leigh
29-Jun-2014, 11:04
Hi Bill,

There are so many significant variables in photography that it's amazing anybody makes a picture. :rolleyes:

Film speed is one that's seldom discussed. I've heard of pros who buy entire film runs and stuff their freezers so they can do one set of tests and have a large stock that conforms to those results.

Besides shutter speed accuracy, you also have shot-to-shot variations due to different temperatures etc.

And let's face it...
A full stop exposure error will only effect shadow detail. Density variations can be handled later.

- Leigh

onnect17
29-Jun-2014, 11:38
Brian,
Contrary to what many members in the forum think, the zone system is not as linear as they want to believe it is. Why I say this?
-The zone system is totally based on a subjective evaluation of exposure. The gray point is not he same for you under different light sources, subjects, etc. Even the guy next to you could pick a different point.
-To allocate the zone V in the center (gray) you are placing zone X two and a half stops on one side and infinite stops on the way to the other side, pure black. That could match one to one after the non-linear negative development curve is corrected with the non-linear paper development curve.
-The idea of the zones being separated by one light stop is just not correct and trying to modify a meter to follow it does not resolve the issue. Moving one zone left and right should not be a major shift but once you move two or more then it's a different story.
-On the top of that many factors must be observed in order to obtain the same density in the negative. Few of them include light temperature, color filtration, emulsion response, filtration compensation, metering, etc. The film development is easier to control so could be a smaller source for error.
-At the end all the inaccuracies are getting "fixed" during printing. That's why many users of the zone system rely on it.

Perhaps of you interest is the interpretation of the zones made by Stouffer.

RZ9 Zone System Chart Specifications

Zone Target Tolerance %_Light_Reflection
I 1.85 .07 1.57
II 1.65 .07 2.50
III 1.35 .07 5.0
IV 1.05 .05 10.0
V .75 .04 20.0
VI .45 .03 40.0
VII .22 .02 68.0
VIII .12 .02 85.0
IX .05 .02 100.0 (base)