altering exposure on an image

Discussion in 'Digital Photography' started by bugbear, Jan 22, 2008.

  1. bugbear

    bugbear Guest

    When merging photographs (e.g. for a panorama)
    it is desirable to use a camera where the exposure
    can be locked, so that the multiple images
    are all taken with the same exposure.

    Let's assume one either can't (or more likely didn't)
    do this.

    How can I correct for either variable shutter speed,
    or variable aperture, or both?

    I don't think I can just linearly scale
    the data, since in a JPEG file from a digicam;
    I think the samples are in a log space, with gamma
    applied.

    So I believe I would need to "ungamma" and "regamma"
    before and after any scaling. Does anyone have
    actual details? The exif data for my camera
    does not have this value.

    I plan to use this:
    http://netpbm.sourceforge.net/doc/pnmgamma.html

    and move into and out of 16 bit representation for accuracy:
    http://netpbm.sourceforge.net/doc/pamdepth.html

    whilst using this (easy!) for the scaling itself:
    http://netpbm.sourceforge.net/doc/pamfunc.html

    I think the scaling for aperture is a simple linear
    model where quantity of light is linearly
    proportional to time, but would welcome confirmation.

    Does anyone know how f-stop relates to quantity
    of light e.g. what the light level ratio between f5 and f8
    would be?

    BugBear
    bugbear, Jan 22, 2008
    #1
    1. Advertising

  2. bugbear wrote:
    > When merging photographs (e.g. for a panorama)
    > it is desirable to use a camera where the exposure
    > can be locked, so that the multiple images
    > are all taken with the same exposure.
    >
    > Let's assume one either can't (or more likely didn't)
    > do this.
    >
    > How can I correct for either variable shutter speed,
    > or variable aperture, or both?

    []
    > BugBear


    Use program like Autostitch and it does it all for you.....

    http://www.cs.ubc.ca/~mbrown/autostitch/autostitch.html

    What I tend to do for my pano shots (all less than 180 degrees) is to take
    exposure from one fixed point (usually the mid point of the set) and,
    having set the exposure, swivel to the next image in the set. So I start
    with the middle picture, take it, re-expose (half-press), swivel left and
    take, revert to the middle, half-press, swivel right and take, and so on.
    Easier to do than describe.

    Cheers,
    David
    David J Taylor, Jan 22, 2008
    #2
    1. Advertising

  3. bugbear

    Dave Cohen Guest

    bugbear wrote:
    > When merging photographs (e.g. for a panorama)
    > it is desirable to use a camera where the exposure
    > can be locked, so that the multiple images
    > are all taken with the same exposure.
    >
    > Let's assume one either can't (or more likely didn't)
    > do this.
    >
    > How can I correct for either variable shutter speed,
    > or variable aperture, or both?
    >
    > I don't think I can just linearly scale
    > the data, since in a JPEG file from a digicam;
    > I think the samples are in a log space, with gamma
    > applied.
    >
    > So I believe I would need to "ungamma" and "regamma"
    > before and after any scaling. Does anyone have
    > actual details? The exif data for my camera
    > does not have this value.
    >
    > I plan to use this:
    > http://netpbm.sourceforge.net/doc/pnmgamma.html
    >
    > and move into and out of 16 bit representation for accuracy:
    > http://netpbm.sourceforge.net/doc/pamdepth.html
    >
    > whilst using this (easy!) for the scaling itself:
    > http://netpbm.sourceforge.net/doc/pamfunc.html
    >
    > I think the scaling for aperture is a simple linear
    > model where quantity of light is linearly
    > proportional to time, but would welcome confirmation.
    >
    > Does anyone know how f-stop relates to quantity
    > of light e.g. what the light level ratio between f5 and f8
    > would be?
    >
    > BugBear


    With a canon, when shooting in stitch mode exposure and white balance
    are set after the first shot. This seemed to work fine for me the few
    times I've used this feature. A f-stop step doubles/halves the exposure.
    Dave Cohen
    Dave Cohen, Jan 22, 2008
    #3
  4. bugbear

    bugbear Guest

    Dave Cohen wrote:
    > bugbear wrote:
    >
    > With a canon, when shooting in stitch mode exposure and white balance
    > are set after the first shot. This seemed to work fine for me the few
    > times I've used this feature.


    Yes; my question relates to photographs taken
    *without* such features, or equivalent precuations.

    > A f-stop step doubles/halves the exposure.


    Yes, but what about f-numbers?

    It appears

    http://www.uscoles.com/fstop.htm

    that area of the aperture is the key thing,
    and that area has a square (or inverse square)
    relationship to f number.

    Therefore the ratio of f5 to f8 for light gethering

    is 8^2/5^2 = 64/25 = 2.56

    The numbers for 22 vs 16 = 484/256 = 1.89 which is close enough
    to 2 to make me happy.

    Can anyone confirm my analysis and/or conclusion?

    BugBear
    bugbear, Jan 22, 2008
    #4
  5. bugbear

    Paul Furman Guest

    bugbear wrote:
    > Dave Cohen wrote:
    >> bugbear wrote:
    >>
    >> With a canon, when shooting in stitch mode exposure and white balance
    >> are set after the first shot. This seemed to work fine for me the few
    >> times I've used this feature.

    >
    > Yes; my question relates to photographs taken
    > *without* such features, or equivalent precuations.
    >
    >> A f-stop step doubles/halves the exposure.

    >
    > Yes, but what about f-numbers?
    >
    > It appears
    >
    > http://www.uscoles.com/fstop.htm
    >
    > that area of the aperture is the key thing,
    > and that area has a square (or inverse square)
    > relationship to f number.
    >
    > Therefore the ratio of f5 to f8 for light gethering
    >
    > is 8^2/5^2 = 64/25 = 2.56
    >
    > The numbers for 22 vs 16 = 484/256 = 1.89 which is close enough
    > to 2 to make me happy.
    >
    > Can anyone confirm my analysis and/or conclusion?


    I'm no mathematician so I did a spreadsheet and it works like this:
    Assume 50mm focal length, it really doesn't matter, then the diameter of
    the aperture is fl/f-stop 50/5 & 50/8
    so 10 & 6.3
    then to get area of the aperture:
    pi*r^2 or in excel: =PI()*((B2/2)*(B2/2))
    so 79 & 31
    now the difference in stops is the two areas divided:
    1.3 stops difference.
    Paul Furman, Jan 22, 2008
    #5
  6. bugbear

    John Navas Guest

    On Tue, 22 Jan 2008 14:01:08 GMT, "David J Taylor"
    <-this-bit.nor-this-bit.co.uk> wrote in
    <EGmlj.81353$>:

    >bugbear wrote:
    >> When merging photographs (e.g. for a panorama)
    >> it is desirable to use a camera where the exposure
    >> can be locked, so that the multiple images
    >> are all taken with the same exposure.
    >>
    >> Let's assume one either can't (or more likely didn't)
    >> do this.
    >>
    >> How can I correct for either variable shutter speed,
    >> or variable aperture, or both?

    >[]
    >> BugBear

    >
    >Use program like Autostitch and it does it all for you.....


    Likewise hugin, which is both excellent and free.

    --
    Best regards,
    John Navas
    Panasonic DMC-FZ8 (and several others)
    John Navas, Jan 22, 2008
    #6
  7. bugbear

    dj_nme Guest

    bugbear wrote:
    > Dave Cohen wrote:
    >
    >> bugbear wrote:

    <snip>
    >> A f-stop step doubles/halves the exposure.

    >
    >
    > Yes, but what about f-numbers?


    Ideally, each f-stop step either halves or doubles the area of the
    apeture opening.
    This means that the f-stop ratio should go up or down by the square root
    of 2 (1.414).
    An absolutely "ideal" f-stop series would look something like (if
    accurate to 1 decimal place):
    f1:1, f1:1.4, f1:2, f2:2.8, f1:4, f1:5.7, f1:8, f1:11.3, f1:16, f1:22.6
    and so on.
    The only real difference is that there is traditionally a half-stop
    between f1:2.8 and f1:4 at f1:3.2 and the numbers are usually rounded to
    the nearest whole number higher in series (eg: f1:11 and f1:22).
    In practical terms it makes no difference, as film/sensor sensitivity
    only steps in whole stops (eg: ISO 100 to 200 to 400) and the small
    percentage error caused by rounding f-stop numbers (which may be in
    whole stops in the mechanics of the apeture and only marked around the
    apeture ring on the lens-barrel in the traditional way) has little or no
    effect.
    dj_nme, Jan 23, 2008
    #7
  8. bugbear <bugbear@trim_papermule.co.uk_trim> writes:
    >When merging photographs (e.g. for a panorama)
    >it is desirable to use a camera where the exposure
    >can be locked, so that the multiple images
    >are all taken with the same exposure.


    >Let's assume one either can't (or more likely didn't)
    >do this.


    >How can I correct for either variable shutter speed,
    >or variable aperture, or both?


    >I don't think I can just linearly scale
    >the data, since in a JPEG file from a digicam;
    >I think the samples are in a log space, with gamma
    >applied.


    No, the samples are in gamma-corrected space, *not* log space. To a
    first approximation, the values in the file are proportional to light
    intensity raised to the 0.45 power.

    To make the image (for example) one stop brighter if it was in linear
    space, you'd multiply all pixel values by 2. In gamma-corrected space,
    you multiply all pixel values by 2^0.45 = 1.37. The effect is the
    same.

    >So I believe I would need to "ungamma" and "regamma"
    >before and after any scaling. Does anyone have
    >actual details? The exif data for my camera
    >does not have this value.


    For a quick test, you don't need to undo and redo gamma correction; just
    multiply the pixel values.

    But in reality, the camera encoding process may have used an exponent
    somewhat different from 0.45, and it may have compressed the highlights
    by using a lower gamma for that portion of the tonal range. For the
    highest quality results, you should undo the effects of any such
    processing in the camera. But first you'd have to figure out what the
    camera did.

    >I plan to use this:
    >http://netpbm.sourceforge.net/doc/pnmgamma.html


    >and move into and out of 16 bit representation for accuracy:
    >http://netpbm.sourceforge.net/doc/pamdepth.html


    >whilst using this (easy!) for the scaling itself:
    >http://netpbm.sourceforge.net/doc/pamfunc.html


    If you don't have a model for how the camera encoding departed from the
    power-law encoding described above, staying in gamma-corrected space
    works just as well.

    >I think the scaling for aperture is a simple linear
    >model where quantity of light is linearly
    >proportional to time, but would welcome confirmation.


    >Does anyone know how f-stop relates to quantity
    >of light e.g. what the light level ratio between f5 and f8
    >would be?


    F-numbers are inversely proportional to the diameter of the lens
    entrance pupil. Light throughput is proportional to the *square* of
    entrance pupil diameter. So to compare light flux for two different
    apertures, take one over the square of the ratio. For example, going
    from f/5 to f/8 reduces the light by a factor of 0.39.

    Dave
    Dave Martindale, Jan 23, 2008
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Merv
    Replies:
    10
    Views:
    688
    Francois Labreque
    Feb 17, 2006
  2. ºoºfizzyºoº

    Altering registry names

    ºoºfizzyºoº, Oct 28, 2003, in forum: Computer Support
    Replies:
    3
    Views:
    421
    °Mike°
    Oct 28, 2003
  3. Mac Lynch

    Want to swap HD's without altering jumpers Win XP

    Mac Lynch, Jul 16, 2005, in forum: Computer Support
    Replies:
    7
    Views:
    1,062
    Toolman Tim
    Jul 18, 2005
  4. S. S.
    Replies:
    3
    Views:
    514
    Dave Martindale
    Jun 24, 2004
  5. Replies:
    2
    Views:
    804
Loading...

Share This Page