|
Convenient web based access to our favorite web design Usenet groups
|
 |
This is Interesting: Free Magazines for Graphics designers and webmasters
| Author |
| Thread |
 |
|
|
|
|
|
 |
 |
|
|
 |
 |
Re: Exposure and histogram stretching |
 |
|
 |
|
|
|
  05-27-04 - 12:14 PM
|
On Wed, 26 May 2004 18:47:11 GMT, phoney.email@yahoo.com (Don) wrote:
>PS 6. Somewhat theoretical questions but I hope someone responds.
>
>Using Photoshop, how do I emulate image (histogram) changes resulting
>from scanner exposure boost? This is not as simple as it may appear:
>
>I ran some tests with my film scanner by increasing exposure by a
>fixed amount (0.1 ev increments). I then plotted the pixel value
>increase against ev increments and the result, instead of a straight
>line, was a slightly upward sloping curve. In other words the
>histogram did not just move to the right from scan to scan but was
>actually "stretched" (as expected). Pixels on the left "moved" more
>slowly than pixels on the right i.e. the distance between darkest and
>brightest pixels increased with exposure boost (more dynamic range).
>
>Taking the baseline scan (before exposure increases) and applying
>brightness to it in Photoshop resulted in a different histogram. This
>time the whole histogram just shifted to the right, but the distance
>between the darkest and brightest pixels remained the same (same
>dynamic range).
>
>So, how do I emulate this non-linear exposure histogram "stretching"
>in PS? I know, "use curves", but how exactly?
If there is room on the brighter side then brightness will do what you
have seen - move the whole structure to the right.
To expand the dynamic range try "levels": The darkest point in your
image may be RGB (15,15,15), the brightest RGB (200,200,200) then the
186 intensities you have are spread over the full 256 value range
(this might lead to banding if there are too few intensities used).
Michael
|
|
|
| [
Post Follow-Up to this message ]
|
|
|
|
|
 |
|
|
 |
|
|
 |
 |
Re: Exposure and histogram stretching |
 |
|
 |
|
|
|
  05-28-04 - 12:14 AM
|
phoney.email@yahoo.com (Don) wrote in message news:<40b4e56c.5547930@news.individual.net>..
.
> PS 6. Somewhat theoretical questions but I hope someone responds.
>
> Using Photoshop, how do I emulate image (histogram) changes resulting
> from scanner exposure boost? This is not as simple as it may appear:
>
> I ran some tests with my film scanner by increasing exposure by a
> fixed amount (0.1 ev increments). I then plotted the pixel value
> increase against ev increments and the result, instead of a straight
> line, was a slightly upward sloping curve. In other words the
> histogram did not just move to the right from scan to scan but was
> actually "stretched" (as expected). Pixels on the left "moved" more
> slowly than pixels on the right i.e. the distance between darkest and
> brightest pixels increased with exposure boost (more dynamic range).
>
> Taking the baseline scan (before exposure increases) and applying
> brightness to it in Photoshop resulted in a different histogram. This
> time the whole histogram just shifted to the right, but the distance
> between the darkest and brightest pixels remained the same (same
> dynamic range).
>
> So, how do I emulate this non-linear exposure histogram "stretching"
> in PS? I know, "use curves", but how exactly?
>
> And while we're at it, given an arbitrary starting pixel value and a
> specific EV exposure increase applied to it, does anyone happen to
> know the formula to calculate the resulting pixel value?
>
> Don.
Don,
I can only comment your last question, but not by "exposure":
x1 old left end of histogram
x2 old right end of histogram
u1 new left end
u2 new right end
x input
y old output
v new output
Old: y = x
New: v = x1 +(x-u1)*(x2-x1))/(u2-u1)
Test:
x=u1: v=x1
x=u2: v=x2
Two test points are sufficient, because itīs a linear function.
Can you replace (u2-u1)/(x2-x1) by "exposure" ?
A drawing would show:
Old: straight line through y(x1)=x1 and y(x2)=x2
New: straight line through v(u1)=x1 and v(u2)=x2
Best regards --Gernot Hoffmann
|
|
|
| [
Post Follow-Up to this message ]
|
|
|
|
|
 |
|
|
 |
|
|
 |
 |
Re: Exposure and histogram stretching |
 |
|
 |
|
|
|
  05-28-04 - 09:14 AM
|
phoney.email@yahoo.com (Don) wrote in message news:<40b66caa.8126420@news.individual.net>..
.
> Hi Gernot,
>
> I'm afraid I don't follow completely. Can you please explain what do
> you mean by input (x), old output (y) and new output (v)?
>
> To explain it another way I was expecting the formula to look
> something like:
>
> u1 = x1 + offset1
> u2 = x2 + offset2
>
> or in a general form:
>
> new pixel value = old pixel value + offset
>
> where "offset" is a function of both exposure and of old pixel value.
>
> My tests show that "offset" is directly proportional to both the
> exposure and the starting (old) pixel value. So:
> The larger the initial (old) pixel value, the larger the offset.
> The larger the exposure, the larger the offset.
>
> Also, I just learned elsewhere that gamma plays an important part in
> all this and since I work in gamma 2.2 this may account for non-linear
> pixel value progression.
>
> Don.
Don,
my previous suggestion was a stretching but not the expected one.
A new attempt:
The darkest entry in a histogram is at x1, the lightest at x2.
x1 should be mapped to u1, e.g. to u1=0.
x2 should be mapped to u2, e.g. to u2=1 (normalized instead of 255).
In a linear space this is a linear function:
v(x) = a + b*x
x is the input and v(x) the modified output.
We know two points:
a + b*x1 = u1
a + b*x2 = u2
The linear equations can be solved by Cramerīs rule.
v(x) = a + x*b = (u1*x2-u2*x1)/(x2-x1) + x*(u2-u1)/(x2-x1)
Special case: u1=0, u2=1
v(x) = (x-x1)/(x2-x1)
v(x1)=0 and v(x2)=1 as expected.
Application for Gamma encoded values
Input x=0..255
Output v=0..255
Replace x by (x/255)^G
Replace v by Round(255*v^(1/G))
Best regards --Gernot Hoffmann
|
|
|
| [
Post Follow-Up to this message ]
|
|
|
|
|
 |
 |
Re: Exposure and histogram stretching |
 |
|
 |
|
|
|
  05-28-04 - 05:14 PM
|
On 28 May 2004 00:17:12 -0700, hoffmann@fho-emden.de (Gernot Hoffmann)
wrote:
>Don,
>
>my previous suggestion was a stretching but not the expected one.
>A new attempt:
>
>The darkest entry in a histogram is at x1, the lightest at x2.
>x1 should be mapped to u1, e.g. to u1=0.
>x2 should be mapped to u2, e.g. to u2=1 (normalized instead of 255).
>
>In a linear space this is a linear function:
>v(x) = a + b*x
>
>x is the input and v(x) the modified output.
>We know two points:
>
>a + b*x1 = u1
>a + b*x2 = u2
>
>The linear equations can be solved by Cramerīs rule.
>
>v(x) = a + x*b = (u1*x2-u2*x1)/(x2-x1) + x*(u2-u1)/(x2-x1)
>
>Special case: u1=0, u2=1
>v(x) = (x-x1)/(x2-x1)
>v(x1)=0 and v(x2)=1 as expected.
>
>Application for Gamma encoded values
>Input x=0..255
>Output v=0..255
>Replace x by (x/255)^G
>Replace v by Round(255*v^(1/G))
>
>Best regards --Gernot Hoffmann
Hi Gernot,
OK, that makes sense now!
I still have to chase up "Cramerīs rule" on the Net, but at least I
have to enough to get going.
Thanks very much, as always.
Don.
|
|
|
| [
Post Follow-Up to this message ]
|
|
|
|
|
 |
|
|
 |
|
|
 |
| All times are GMT. The time now is 04:07 AM. |
 |
|
|
|
|
|  |
|