Curves: Emulating scanner exposure

PE
Posted By
phoney.email
May 27, 2004
Views
342
Replies
5
Status
Closed
PS 6.

This is a partial rephrasing/clarification of an earlier question. Assuming a baseline scan, its histogram may appear something like this (o=individual pixel value):

oooooooooooo

After applying some exposure boost (say 0.5 EV) the histogram would look something like this (o=correspending pixels from baseline scan, =new pixel values):

o.o..o…o….o…..

Applying another exposure boost for a cumulative 1.0 EV from baseline (these are all arbitrary values for illustration purpose only) the histogram would stretch even more and now look something like:

o..o….o…….o…….

The question is what curves do I need to apply to the baseline scan to recreate the histograms generated by increasing scanner exposure?

I realize that doing this in Photoshop would create "holes" in the histogram, but that’s not important at this point because I’m after the principles.

Specifically, what formula/rule governs how histograms change after a scanner exposure boost (or, indeed, an exposure cut)? In other words, given an arbitrary starting pixel value and a specific EV exposure increase applied to it, how do I calculate the resulting pixel value?

Don.

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

D
Don
May 27, 2004
Image>Adjustments>Levels, then grab the right-hand input levels slider and move it to the left.

Another Don

"Don" wrote in message
PS 6.

This is a partial rephrasing/clarification of an earlier question. Assuming a baseline scan, its histogram may appear something like this (o=individual pixel value):

oooooooooooo

After applying some exposure boost (say 0.5 EV) the histogram would look something like this (o=correspending pixels from baseline scan, =new pixel values):

o.o..o…o….o…..

Applying another exposure boost for a cumulative 1.0 EV from baseline (these are all arbitrary values for illustration purpose only) the histogram would stretch even more and now look something like:
o..o….o…….o…….

The question is what curves do I need to apply to the baseline scan to recreate the histograms generated by increasing scanner exposure?
I realize that doing this in Photoshop would create "holes" in the histogram, but that’s not important at this point because I’m after the principles.

Specifically, what formula/rule governs how histograms change after a scanner exposure boost (or, indeed, an exposure cut)? In other words, given an arbitrary starting pixel value and a specific EV exposure increase applied to it, how do I calculate the resulting pixel value?
Don.
MR
Mike Russell
May 27, 2004
Don wrote:
PS 6.

This is a partial rephrasing/clarification of an earlier question. Assuming a baseline scan, its histogram may appear something like this (o=individual pixel value):

oooooooooooo

After applying some exposure boost (say 0.5 EV) the histogram would look something like this (o=correspending pixels from baseline scan, =new pixel values):

o.o..o…o….o…..

Applying another exposure boost for a cumulative 1.0 EV from baseline (these are all arbitrary values for illustration purpose only) the histogram would stretch even more and now look something like:
o..o….o…….o…….

The question is what curves do I need to apply to the baseline scan to recreate the histograms generated by increasing scanner exposure?
I realize that doing this in Photoshop would create "holes" in the histogram, but that’s not important at this point because I’m after the principles.

Specifically, what formula/rule governs how histograms change after a scanner exposure boost (or, indeed, an exposure cut)? In other words, given an arbitrary starting pixel value and a specific EV exposure increase applied to it, how do I calculate the resulting pixel value?

Hi Don,

Short answer: an increase in EV will tend to stretch the brighter values more than the darker ones. For example, (simplifying just a bit) increasing by 1.0 EV doubles the amount of light, so in gamma 1.0 pixel value of 0 will stay fixed, 63 changes to 126, 127 will go to 254, etc.

Long answer: if you plug in the above numbers, they come out a little to low. The reason for this is, in a word, gamma. Gamma is a video display compensation curve that compresses dark values into a larger number of values, keeping black and white the same.

Set up your scanner to gamma 1.0, and your working space to 1.0 gamma by setting up a custom RGB space in your color settings. If your scanner software does not support this, do a convert to profile after the scan. Or convert your scans to the Lab color space, where Lightness will have a linear relationship to the amount of captured light.

After you’ve done that, your numbers will begin to make sense.

Charles Poynton gives a good description of gamma here, with equations: http://www.poynton.com/GammaFAQ.html

The illustrious Alvy Ray Smith, inventor of the alpha channel and z-buffer among other things, has a short discussion here. Alvy makes the broader point, usually ignored by Photoshop folks, that all graphics algorithms assume linear gamma space.
ftp://ftp.alvyray.com/Acrobat/9_Gamma.pdf

I should also warn you that very few people go back to basic principles, as you are doing, and there is a frog and mouse battle going on in the gamma world.

The energetic and animated mouse is played by Timo Autiokari, who advocates linear gamma for everything, with discussion and examples to back it up, while others play the part of the unmoving, intoning frog, simply repeating that nonlinear gamma is the way that everyone does it: end of discussion. In this battle, there have been many ad hominum attacks on Timo, and to his credit he does not respond in kind.

If you are prepared to think back to basic principles, Timo’s body of work is available here:
http://www.aim-dtp.net/

My own position is that for scientific and computer graphics, linear gamma is where it’s at, simply because, as Alvy says, all graphics algorithms assume linear gamma. For everyday photographs it is simply too much work to convert to and from gamma 1.0, so I bow to the omnipresent god of gamma, and go with the flow.


Mike Russell
www.curvemeister.com
www.geigy.2y.net
PE
phoney.email
May 27, 2004
Unfortunately that doesn’t work because Levels are linear. Using my baseline histogram below, after applying Levels the new histogram would look something like this:

o.o.o.o.o.o.o.o.o

which is quite different from what exposure histograms look like.

In other words, Levels just inserts "holes" at fixed intervals while scanner exposure varies the interval depending on the original pixel value (dark pixels "move" less, bright pixels "move" more).

However, after what Mike wrote Levels may (should!) work in gamma 1 which is also linear (but I have to think some more about this).

Previous Don. ;o)

On Thu, 27 May 2004 09:27:12 -0700, "Don" wrote:

Image>Adjustments>Levels, then grab the right-hand input levels slider and move it to the left.

Another Don

"Don" wrote in message
PS 6.

This is a partial rephrasing/clarification of an earlier question. Assuming a baseline scan, its histogram may appear something like this (o=individual pixel value):

oooooooooooo

After applying some exposure boost (say 0.5 EV) the histogram would look something like this (o=correspending pixels from baseline scan, =new pixel values):

o.o..o…o….o…..

Applying another exposure boost for a cumulative 1.0 EV from baseline (these are all arbitrary values for illustration purpose only) the histogram would stretch even more and now look something like:
o..o….o…….o…….

The question is what curves do I need to apply to the baseline scan to recreate the histograms generated by increasing scanner exposure?
I realize that doing this in Photoshop would create "holes" in the histogram, but that’s not important at this point because I’m after the principles.

Specifically, what formula/rule governs how histograms change after a scanner exposure boost (or, indeed, an exposure cut)? In other words, given an arbitrary starting pixel value and a specific EV exposure increase applied to it, how do I calculate the resulting pixel value?
Don.

PE
phoney.email
May 27, 2004
Fantastic! Thanks very much, Mike!

I realize that not everyone wants to delve in this deep but I like to know what I’m doing – or at the very least "know what I don’t know".

I figured out why brighter values move more than darker ones but I wasn’t quite clear on the rate of movement other than it was a function of the starting pixel value and exposure.

Anyway, I’m off to chase up those links and do some reading…

Thanks again! Much appreciated!

Don.

On Thu, 27 May 2004 20:10:40 GMT, "Mike Russell" wrote:

Don wrote:
PS 6.

This is a partial rephrasing/clarification of an earlier question. Assuming a baseline scan, its histogram may appear something like this (o=individual pixel value):

oooooooooooo

After applying some exposure boost (say 0.5 EV) the histogram would look something like this (o=correspending pixels from baseline scan, =new pixel values):

o.o..o…o….o…..

Applying another exposure boost for a cumulative 1.0 EV from baseline (these are all arbitrary values for illustration purpose only) the histogram would stretch even more and now look something like:
o..o….o…….o…….

The question is what curves do I need to apply to the baseline scan to recreate the histograms generated by increasing scanner exposure?
I realize that doing this in Photoshop would create "holes" in the histogram, but that’s not important at this point because I’m after the principles.

Specifically, what formula/rule governs how histograms change after a scanner exposure boost (or, indeed, an exposure cut)? In other words, given an arbitrary starting pixel value and a specific EV exposure increase applied to it, how do I calculate the resulting pixel value?

Hi Don,

Short answer: an increase in EV will tend to stretch the brighter values more than the darker ones. For example, (simplifying just a bit) increasing by 1.0 EV doubles the amount of light, so in gamma 1.0 pixel value of 0 will stay fixed, 63 changes to 126, 127 will go to 254, etc.

Long answer: if you plug in the above numbers, they come out a little to low. The reason for this is, in a word, gamma. Gamma is a video display compensation curve that compresses dark values into a larger number of values, keeping black and white the same.

Set up your scanner to gamma 1.0, and your working space to 1.0 gamma by setting up a custom RGB space in your color settings. If your scanner software does not support this, do a convert to profile after the scan. Or convert your scans to the Lab color space, where Lightness will have a linear relationship to the amount of captured light.

After you’ve done that, your numbers will begin to make sense.
Charles Poynton gives a good description of gamma here, with equations: http://www.poynton.com/GammaFAQ.html

The illustrious Alvy Ray Smith, inventor of the alpha channel and z-buffer among other things, has a short discussion here. Alvy makes the broader point, usually ignored by Photoshop folks, that all graphics algorithms assume linear gamma space.
ftp://ftp.alvyray.com/Acrobat/9_Gamma.pdf

I should also warn you that very few people go back to basic principles, as you are doing, and there is a frog and mouse battle going on in the gamma world.

The energetic and animated mouse is played by Timo Autiokari, who advocates linear gamma for everything, with discussion and examples to back it up, while others play the part of the unmoving, intoning frog, simply repeating that nonlinear gamma is the way that everyone does it: end of discussion. In this battle, there have been many ad hominum attacks on Timo, and to his credit he does not respond in kind.

If you are prepared to think back to basic principles, Timo’s body of work is available here:
http://www.aim-dtp.net/

My own position is that for scientific and computer graphics, linear gamma is where it’s at, simply because, as Alvy says, all graphics algorithms assume linear gamma. For everyday photographs it is simply too much work to convert to and from gamma 1.0, so I bow to the omnipresent god of gamma, and go with the flow.


Mike Russell
www.curvemeister.com
www.geigy.2y.net

D
Don
May 28, 2004
Yes, I think Gamma (the center slider) will do what you have in mind. BTW, I use that a lot.

Don

"Don" wrote in message
Unfortunately that doesn’t work because Levels are linear. Using my baseline histogram below, after applying Levels the new histogram would look something like this:

o.o.o.o.o.o.o.o.o

which is quite different from what exposure histograms look like.
In other words, Levels just inserts "holes" at fixed intervals while scanner exposure varies the interval depending on the original pixel value (dark pixels "move" less, bright pixels "move" more).
However, after what Mike wrote Levels may (should!) work in gamma 1 which is also linear (but I have to think some more about this).
Previous Don. ;o)

On Thu, 27 May 2004 09:27:12 -0700, "Don" wrote:
Image>Adjustments>Levels, then grab the right-hand input levels slider
and
move it to the left.

Another Don

"Don" wrote in message
PS 6.

This is a partial rephrasing/clarification of an earlier question. Assuming a baseline scan, its histogram may appear something like this (o=individual pixel value):

oooooooooooo

After applying some exposure boost (say 0.5 EV) the histogram would look something like this (o=correspending pixels from baseline scan, =new pixel values):

o.o..o…o….o…..

Applying another exposure boost for a cumulative 1.0 EV from baseline (these are all arbitrary values for illustration purpose only) the histogram would stretch even more and now look something like:
o..o….o…….o…….

The question is what curves do I need to apply to the baseline scan to recreate the histograms generated by increasing scanner exposure?
I realize that doing this in Photoshop would create "holes" in the histogram, but that’s not important at this point because I’m after the principles.

Specifically, what formula/rule governs how histograms change after a scanner exposure boost (or, indeed, an exposure cut)? In other words, given an arbitrary starting pixel value and a specific EV exposure increase applied to it, how do I calculate the resulting pixel value?
Don.

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

Related Discussion Topics

Nice and short text about related topics in discussion sections