Film curve plotting and fitting

OP
OP

dpgoldenberg

Member
Joined
Feb 18, 2009
Messages
50
Format
Med. Format RF

Actually, I don't think that this is what these authors were really doing. They discuss the function y = 1/ (1+ e^-x) at the beginning of the paper as an example of a function that looks like a film curve, but that actually doesn't work so well (more about this function, below). It is not the same as their F(x), which represents a generic function that can be used to described a family of curves. In practice, they suggest using for F(x) real, measured data from a film-developer combination that, with the adjustments, can be fit to other data. The parameters f, c and h are all relative to the control measurements. This obviously requires having very good data for the reference curve. It would be interesting to know if this method was actually adopted at Kodak.

To address, Ralph's question; yes, an increase in h causes an increase in y for a given x value. But, that represents a shift of the curve to the right, i.e. an increase in speed.

The "s-shaped function" described above is actually one that I had suggested in an earlier thread:

(there was a url link here which no longer exists)

After a bit of fooling around with this function, I realized that it probably wasn't all that great for this purpose. One limitation is that the width of the toe is not independent of other parameters. In addition, the curve is intrinsically symmetrical, so that the shoulder is basically a reflection of the toe. So, then I was thinking that what I wanted was a function for which the derivative (gradient) would start at zero, increase over an adjustable range of x values and approach a limiting value, without worrying about the shoulder My original function (the "logistic growth equation") behaves just as I wanted the derivative of a function to behave. So, the function that I proposed in the first post to this thread is actually the anti-derivative (integral) of the s-shaped function.

Try it, you'll like it (for the toe and linear regions of film curves, not paper)!

David
 

Photo Engineer

Subscriber
Joined
Apr 19, 2005
Messages
29,018
Location
Rochester, NY
Format
Multi Format
The actual curves we used at EK for film and paper were cubic splines as I noted earlier. I am gathering some references pertinent to this and when I can I will scan in some additional information that may be of interest.

PE
 

ic-racer

Member
Joined
Feb 25, 2007
Messages
16,633
Location
USA
Format
Multi Format

Their F(X) is the logistic growth equation with the added modifying parameters f, c and h.

The curve only fits well at the toe. They mention that in the section "Degree of Fit"

*Description of d-log E curves by specifically chosen parameters
1961, Bayer et al.
in
Photographic Science and Engineering Vol 5, No. 1, Jan.Feb
 
Last edited by a moderator:
Joined
Dec 27, 2004
Messages
475
Location
Arlington, M
Format
Medium Format

Excellent points! I was educated as a physical chemist, yet I keep my own testing fairly simple. But that's because I'm normally trying to stay on the linear part of the curve. That frees up a lot of time for making photos!
 

Lee L

Member
Joined
Nov 17, 2004
Messages
3,281
Format
Multi Format
I tried all the equations recommended in this thread but none work a swell as the one I proposed in post #39

Ralph,

Could you please supply the data that fit with this form of equation with units shown. I'm getting the attached curves from your post #39 equations for TMY and MGIV grade 2, and I can guess where the film and paper curves might fit in, but it would be good to know which regions of these curves you're working in, and what units you're using.

I've added a second graph with the x-axis reversed (relative to the x-axis numbers you appear to be using) to show more clearly what is happening (i.e adjusted for the orientation in which we typically read film curves). It appears to be relative log exposure vs. density, but with values on the x-axis reversed (values decreasing left to right) from the equations given in post #39.

Thanks,
Lee
 

Attachments

  • postno39curves.png
    43.4 KB · Views: 90
  • postno39curvesreversedxaxis.png
    40.3 KB · Views: 85
Last edited by a moderator:

RalphLambrecht

Subscriber
Joined
Sep 19, 2003
Messages
14,706
Location
K,Germany
Format
Medium Format
Lee

The data is attached, but pay close attention to the attached graph in post #209. Deltagraph can be told how many iteration to conduct and to stop at a certain accuracy level. I usually use a max of 32 iteration and stop below an accuracy of R^2 (?) <= 0.01. If I ask for more iterations, I also get the peaks you're getting.

By the way, you can see the raw data (thin red line) in the graph laying below the thicker blue line. The fit is extremely good. The units are relative log exposure and absolute reflection density.
 

Attachments

  • Workbook1.xls
    20.5 KB · Views: 131

Lee L

Member
Joined
Nov 17, 2004
Messages
3,281
Format
Multi Format
Thanks Ralph.

The curves shown in my graphs are your solutions for TMY and MGIV grade 2, the 'solved' equations you posted in #39 of this thread. I literally cut and pasted your two solved equations from post #39 into python and graphed them over the range x=-2 to x=10 in the first graph and over the range x=5 to x=-2 (lower values going right) in the second graph. The only change I made was in the power function character, from '^' to the equivalent '**' for python syntax. So the graphs I posted literally use your Deltagraph output, they just cover a wider range than your data, and the peaks are in your equations, just outside the range you use for data.

I like to see more of the curve to get a sense of the math and a visual display of what the curve actually describes, even if you're only using a limited portion of the curve to describe film and paper. However, I didn't show out to x=-2.21 for the curves, as your TMY equation peaks near there at about y=1280, which blows the detail because of the extended y-axis.

I've added your raw MGIV at grade 2 data to my python plot and attached it so that folks can see what portion of the curves you're fitting. I suspect that the fit is affected to some degree by the number of significant digits shown in Deltagraph's equation display combined with the number of terms and exponentials involved.

Lee
 

Attachments

  • lambrechtdataandderivedcurves.png
    53.4 KB · Views: 96
Last edited by a moderator:

ic-racer

Member
Joined
Feb 25, 2007
Messages
16,633
Location
USA
Format
Multi Format
I tried all the equations recommended in this thread but none work a swell as the one I proposed in post #39. I'm sticking to it, because it works fine for film and paper.

y=(a0+a1*x+a2*x^2)/(b0+b1*x+b2*x^2+b3*x^3)

It returned the following curve for Tmax-400 data for a 16min development at 20C.

y=(2.356E+0-1.641E+0*x+2.908E-1*x^2)/(9.844E-1-1.894E-1*x-1.660E-1*x^2+5.433E-2*x^3)
R^2 = 9.998E-1
I would agree that which you have posted (or some others that Delta Graph can provide) can yield very low R value and thus have a very nice fit. However, getting speed and contrast data from that resulting equation is going to be the hard part (for me).

Just for clarification purposes and to compare and contrast, the method I put up (also fitted using Delta Graph) might yield a curve fit like this:

y=6.838E-1*x+ 4.16E-1 and
x= 1.407 *y + 2.432
R^2 = 9.9865E-1

The advantage to the way I am doing it is that I can read contrast and speed right from the equation spit out by DeltaGraph without any additional calculations!

So, in my example above the contrast is 0.68 and the speed is 2.4 (for my purposes easily converted to DIN 24)
 
Last edited by a moderator:

Nicholas Lindan

Advertiser
Advertiser
Joined
Sep 2, 2006
Messages
4,277
Location
Cleveland, Ohio
Format
Multi Format
I swore I would stay out of this thread ...

When fitting a mathematical function to a physical process one should use a function that is derived from the physics of the process. If that is not possible one should use the simplest representation that gives an adequate numerical result.

Fitting polynomials to data points - splining - originated with naval architecture. A spline is simply a bent stick http://en.wikipedia.org/wiki/Flat_spline used to generate a curve for drawing the shape of a ship’s hull. The spline stick was held in place by ‘knots’ or ‘dog’ weights. Spline interpolation, formalized by Newton, uses a series of polynomials to represent the curve of the spline stick given the position of the knots - thus allowing the computation of a smooth ship’s hull to an arbitrary precision using rather crude data as the input. The technique has expanded to any application where intermediate data points are required. The most common mathematical splines are cubic functions that fit 4 points or 3 points and a first derivative - only the curve between the inner points is used as the generated curve. A curve of n knots is represented by n - 1 seperate polynomial functions, each with four coefficients; it is hardly a data reduction technique. The same technique can be used to generate a set of polynomials that have continuous second derivatives at the knots - useful in the design of roller coasters and cams where smooth acceleration is required.

Spline interpolation is very common simply because it is convenient. It will generate a well behaved curve through any arbitrary set of data points. The technique is heavily used in computer aided mechanical design and computer generated graphics. However, there are no physical processes that follow a splined function and thus the technique is frowned upon for modeling natural phenomenon.

It is possible to take the spline concept further and generate higher order polynomials and ratios of polynomials in an attempt to fit one equation to a complete set of data points. The results are often unsatisfactory as the function is not well behaved at the ends of the data set and the higher derivatives of the function are ‘bumpy’ http://en.wikipedia.org/wiki/Runge's_phenomenon . The somewhat sophomoric approach of fitting, say, a 9th order polynomial to 10 data points also suffers from the amplification of measurement noise that is inevitable when determining the data points.

Least-squares curve fitting is the correct method of determining function coefficients that model a data set http://en.wikipedia.org/wiki/Least_squares . A least-squares curve will not go through the data points like a set of splined polynomials will. However, this can often be a blessing as the curve will smooth out the noise of the measurements used to generate the data set. The least squares method is not limited to polynomials and can be used to find the coefficients for any arbitrary function. It is always a good idea to use a function that has something to do with the underlying physical process: polynomials for power-law relations; straight lines for linear relations; exponentials, logarithms and sines & cosines for differential equations.

The physical processes that give rise to the HD curve are covered in chapter 5 of Meese, revised ed.. The three parts of the HD curve are due to different physical processes and therefore there is no one function that models the entire curve. Meese also points out that it is often easier to deal with the derivative (dD/dE) of the HD curve as the physical process of image formation gives rise to a function that gives the increase in density for an increase in exposure. The resulting function is integrated to give the HD curve.

The physics of image formation give rise to dD/dE equations of the same form as the normal ‘bell-curve’ Gaussian distribution function http://en.wikipedia.org/wiki/Gaussian_function . It is possible to model the toe and the shoulder region as halves of the standard bell curve, each half having different parameters. Although Meese doesn’t go into it, the straight line joining the toe and shoulder of modern emulsions is adequately modeled with, of all things, a straight line.

The result of integrating two 1/2 bell curves, one for the toe and one for the shoulder, with a straight line in between, is shown below.

It is - relatively - easy to fit this set of three functions to a real-life HD curve.

As the function is derived from the physics of the exposure process it has few artifacts, is continuous for all derivatives, and is well behaved outside of the set of data points. The resulting function has an infinite toe and shoulder that quickly become asymptotic to dmin and dmax, even if only the inner portion of the HD curve is used for data points.

However one should keep in mind that most modern materials are made from more than one emulsion and it will require the summation of an HD curve for each emulsion to generate the HD curve of the paper or film. This can be seen clearly in the roller-coaster shape of the HD curve for a variable contrast paper. When one is faced with the decomposition of a material’s HD curve into the response of its individual layers/emulsions the job becomes a PITA and the resulting mathematical function a hideous over complication.

The simplest approach is to use the raw measurement data points as the definition of the HD curve and do a simple linear interpolation between the data points. This no-brainer method yeilds intermediate results that are within a few percent of the real curve - far more accurate than any shutter. And the method is completely immune from artifacts and malignant behavior between and outside of the data points.

Using curve fitting to find a ‘Personal EI’ (PEI) is, IMO, a waste of time. One’s PEI is almost always equal to a -1/3 of a stop adjustment to manufacturer’s speed rating. This is because the methodology for finding a PEI is different from the manufacturer’s method for determining ISO. People are happier using a PEI for negative work because it helps to hide errors in exposure determination - where it is always wise to err on the side of overexposure. After 100 years of refinement the best advice is still ‘Expose for the shadows, develop for the highlights’ and keep as much of the image as possible on the straight portion of the HD curve. It is in printing that the shape of the HD curve becomes important.

In the old days students were required to shoot Kodachrome to prove their ability to properly determine exposure, exposing B&W was considered too much of a cake-walk. To aid in this effort, camera manufacturers calibrated metering systems not to any ASA/ISO standard but to give the best results when shooting slides. Matrix Metering is designed for exposing color slides, which is why it sometimes gives sub-optimal results for negative materials as it's prime directive is "Don't blow the highlights". Usually, setting the camera’s control dial to ‘A’ gives the best results with slides, bracketing if the lighting is tricky.

All this curve fitting is best left to an MS thesis; when taking pictures it leads to paralysis by analysis.
 
Last edited by a moderator:

Photo Engineer

Subscriber
Joined
Apr 19, 2005
Messages
29,018
Location
Rochester, NY
Format
Multi Format
Nicholas is absolutely correct.

And, paralysis by analysis is a good and apt phrase.

For a complete treatment, this methodology is shown in Mees (Revised Edition, chapter by J. L. Tupper) in the analysis of curves starting on Page 870 with Fig 299. On page 878 he ends by showing an evaluation of prints from negatives which, although there is some overlap, has the selected First Excellent Print on the straight line portion of the curve. (Point Z to Point O). This is the flat portion shown in Fig 299 and above by Nicholas. It is also about 1/3 stop over in most cases.

And, since Mees (Tupper's) tests were conducted in-camera, flare is accounted for.

PE
 

ic-racer

Member
Joined
Feb 25, 2007
Messages
16,633
Location
USA
Format
Multi Format
Nice post Nicholas I think I agree with 100% of it as long as I interpret your last sentence as "curve" meaning a non-straight line. My method involves a straight line analysis, so immune from the comment

Of course I have to play devil's advocate and give you a challenge.

I happen to have 6 rolls of 35mm film. There are 3 different types of B&W film; 3 are for myself and 3 are to give you at our next APUG gathering. But I forgot what they are....we both need to expose them develop them based on any info we can gather from the film by testing them with our own methods. To make it more interesting, we won't get the film until after sunset and we need to be ready to shoot with the crazy guys that get up early by sunrise the next day

Whatever method you choose, I'd put that up for comparison in terms of simplicity and speed with the method I posted. (ie, I'd cut off a 6 inch piece of each, shoot off a test wedge, plot it against a known film* and get relative speed info and an idea of how much more or less time I need in the developer. This can all be done without leaving the darkroom.)

*my 'known film's' characteristics have been previously determined by quite a few years of exposure, development, printing and viewing.
 
Last edited by a moderator:

RalphLambrecht

Subscriber
Joined
Sep 19, 2003
Messages
14,706
Location
K,Germany
Format
Medium Format

I don't like the patching of two curves much, and I still feel that it is useful to determine EI, but I fully agree with the above statement.
 

Nicholas Lindan

Advertiser
Advertiser
Joined
Sep 2, 2006
Messages
4,277
Location
Cleveland, Ohio
Format
Multi Format
I don't like the patching of two curves much ...

I agree: it has a certain lack of aesthetics. But just about all real world fitting is done by splicing multiple curves together. Most physical phenomena go through changes in behavior and state over the range of interest: One certainly wouldn't use the same curve to represent the properties of ice, water and steam but they are all joined in a triple-point phase diagram http://en.wikipedia.org/wiki/Phase_diagram. In film, the physics that give rise to the toe are different than those responsible for the shoulder - there is no equation that can represent them both. The presence of wild perturbations outside of the modeled data range is an indication of just how "unhappy" a polynomial is at being forced into the shape of an HD curve. If you really want to annoy a polynomial fit it to e^-x.

High order simple polynomials, though fascinating, are not a good choice for modeling a physical process and are rarely found. Conversely, infinite series of polynomials of sines and cosines are very common - the Fourier series being the most common - but this has it's own problem with unavoidable artifacts - http://en.wikipedia.org/wiki/Gibbs_phenomenon The sines and cosines of the Fourier series being themselves computed with infinite series of polynomials http://en.wikipedia.org/wiki/Taylor_series. What goes around comes around.
 
Last edited by a moderator:

Nicholas Lindan

Advertiser
Advertiser
Joined
Sep 2, 2006
Messages
4,277
Location
Cleveland, Ohio
Format
Multi Format

If I had three apples at the beginning of this experiment and Paul gave me 2 oranges while I was in a boat with a goat, a cabbage and a fox, rowing upstream at 3 miles an hour in a 10 knot headwind while firing a gun with a 10 lb cannonball ...

Sheeeet - just expose at 100 and soup in D-76 for 7 1/2 minutes [ob smiley].
 

Photo Engineer

Subscriber
Joined
Apr 19, 2005
Messages
29,018
Location
Rochester, NY
Format
Multi Format

Believe it or not, that is almost exactly what went through my mind, but I pegged the development at about 9 minutes to be sure. IDK why, but that was what I chose from previous experiences like that.

PE
 

RalphLambrecht

Subscriber
Joined
Sep 19, 2003
Messages
14,706
Location
K,Germany
Format
Medium Format

As you say, I also had only little success with polynominals or Fourier series, yet, the nonlinear equation, I'm using, has only few of their problems and gives a nearly perfect fit for all films and papers, I've tested so far. I've used the 2nd, 3rd and 4th order variant but settled on the 3rd order for most cases now. I prefer it, because there is only one equation describing the entire curve from toe to shoulder.
 
Joined
Dec 27, 2004
Messages
475
Location
Arlington, M
Format
Medium Format

Absolutely! All I do is measure densities for various exposures, use a log transformation, and run a linear regression (the Excel add-in works fine for this). Life is easy if you stay away from the toe and shoulder.

For me, it's a matter of prioritizing my time. I don't think that additional mastery of the technical aspects of exposure and processing will improve my photography as much as learning more about lighting and composition. YMMV.
 
Last edited by a moderator:
Joined
Jan 21, 2003
Messages
15,708
Location
Switzerland
Format
Multi Format
I have tried to read this whole thread, only to prove that the subject matter is way over my head.

I'm sorry if I'm sticking my nose where it doesn't belong, but does all this exercise really make your pictures better? Or is it an exercise in scientific curiosity? Or perhaps both?
If I took my photography to such scientific heights I think my head would explode. So I'm curious what drives the urge to go there.

The goal seems to be to match negative to paper, if I understand it correctly.

Very thankful for being given a glimpse into your worlds.

- Thomas
 

Anon Ymous

Member
Joined
Feb 7, 2008
Messages
3,668
Location
Greece
Format
35mm
I have tried to read this whole thread, only to prove that the subject matter is way over my head.

Hello Thomas. I've also been following this thread, even though I don't have the equipment needed to "plot" my own curves. I have to admit though that I find this stuff fascinating.

I'm sorry if I'm sticking my nose where it doesn't belong, but does all this exercise really make your pictures better? Or is it an exercise in scientific curiosity? Or perhaps both?

Both, as far as I am concerned. It's just the way I understand the things around me, I need to know how things work - behave. In this particular case (films), having a characteristic curve reveals far more than any other method. Phrases like "glowing highlights" and "nice tonality" are far too vague for me. When you have a characteristic curve, you know what to expect, how to expose, etc, etc, etc... On the other hand, the "paralysis by analysis" that N. Lindan said is also true, as far as I am concerned.

If I took my photography to such scientific heights I think my head would explode. So I'm curious what drives the urge to go there.

The goal seems to be to match negative to paper, if I understand it correctly...

Match negative to paper? It can be done, but I don't think that the photograph will necessarily look nice. IMHO, a good negative is one with reasonable contrast, which also has all the necessary detail recorded. A fair share of technical knowledge can help you in getting a fine negative. It's not absolutely necessary, it won't substitute real, hands on experience, but it's good to have it.
 

Lee L

Member
Joined
Nov 17, 2004
Messages
3,281
Format
Multi Format
For my part, reading this thread is just an attempt to understand the character of the process. For reasons beyond my control, I don't get to spend as much time as I'd like actually doing photography, and spending some of my time attempting to improve my knowledge and understanding isn't wasted, as I can apply it to some degree when shooting and processing.

So here's another graph using Ralph's MGIV grade 2 data plotted in red, and a quick manual attempt to match it only at the highlights with a gaussian curve (in blue). It looks pretty decent to me, and doesn't behave wildly outside the range of interest. It also follows the procedure in Nicholas' post, and only tries to match one end of the curve. I haven't attempted to match the darker print densities.

For this gaussian curve:

mu=1 (the x-axis displacement of the peak of the gaussian curve)
sigma=.45

I also included a factor by which to multiply the y value, which for this curve is 2.4.

Lee
 

Attachments

  • lambrechtMGIVdatagaussiancurvefit.png
    25.8 KB · Views: 87
Last edited by a moderator:

ic-racer

Member
Joined
Feb 25, 2007
Messages
16,633
Location
USA
Format
Multi Format
I have tried to read this whole thread, only to prove that the subject matter is way over my head.


I think there are a number of 'sub threads in here' but the main questions to be answered are straight forward :

1) How much exposure?
2) How much development?

You can:

1) guess
2) use someone elses data
3) test

For me, I use a combination of all the above. I guess, based on someone else's data (big development chart or MFG info) and once I'm happy with the negatives and prints I test. The results of the test are used to compare to a new 'unknown' film. The goal is to speed up the years of trial and error.
 
Joined
Jan 21, 2003
Messages
15,708
Location
Switzerland
Format
Multi Format
So it's a way to quantify results?

To do this within tolerable measurements you would have to use sheet film, so that each negative can be exactly calculated. With roll film I would think there are so much variation between frames that it's impossible to calculate a scientifically perfect way of processing the film, because the other 35 frames on your roll would be different in contrast, lighting, and exposure.

I think that some people are very curious and just have to know the math behind a concept before it makes sense, or take satisfaction in mastering it that way.
And others, like me, contact print the film strips, print the negs a lot, learn from the observations and pile the accumulated in a big stack called 'experience', and don't worry about it much. Just go do again, hopefully a tiny bit better each time.

I'm grateful that there are people out there that are so interested in this stuff, because ultimately it will make more people understand it, and I can see a future where all of this knowledge will be very scarce; it is good to keep it alive, and to document it.

Thanks.

 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…