Pages: [1]   Go Down

Author Topic: how to apply custom gamma exponent to image (starting from 16 bit linear TIFF)  (Read 2393 times)

spacediver

  • Newbie
  • *
  • Offline Offline
  • Posts: 6

In an attempt to start to learn about tone mapping, I'm doing some experimentation.

My display is accurately calibrated to a gamma of 2.4.

What I'm trying to do is this:

Load up a graybar pattern - an arrangement of consecutive vertical bars, ranging from black to white.

Take a raw image of this pattern with my Canon EOS 450D (using appropriate exposure to avoid saturation or floor effects).

Use dcraw to convert to a linear bit tiff.

Then use some piece of software (I have gimp and lightzone) to first normalize the image, and then apply a 2.4 gamma curve to the image.

Then compare the final rendered image with the original pattern that was photographed. Ideally, they should match.

So far, all I've been able to do is either save the file as an image (and choose various encoding profiles, such as sRGB, which has its own gamma function) or manually manipulate curves. Is there any way I can apply custom gamma exponents to the image and see the resulting change (preferably real time)?
Logged

fdisilvestro

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 1852
    • Frank Disilvestro

You can use the "levels" adjustment. The center slider in the "input levels" control is related to gamma, or more precisely 1/gamma

So, if you want to use a gamma of 1.8, then move the center slider to 1/1.8 = 0.55; for gamma 2.2 use 1/2.2 = 0.45

Another option is to specify the gamma in DCRAW (if you already know how to use it) with the option "-g", where you can specify the power and toe-slope of the TRC (Tone response curve)

For instance if you want to process your file with the sRGB TRC, which is a toe-slope of 12.92 and a power of 2.4  (gamma 2.2 is an approximation, not the real curve) you will use the option -g 2.4 12.92

The attached image shows the "levels" dialogue from Photoshop. As far as I know, there is a similar "levels" dialogue in GIMP

spacediver

  • Newbie
  • *
  • Offline Offline
  • Posts: 6

thanks very much Francisco, that answers my question perfectly. If things turn out interestingly, I'll report back here.
Logged

kirkt

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 604

If you are using Photoshop, this plug-in (free) might be useful - it permits the user to write an arbitrary math function output=f(input) and then makes a curves adjustment layer out of the function:

http://www.davidebarranca.com/2013/03/parametric-curves-script-for-photoshop-user-guide/

kirk

Logged

Hening Bettermann

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 945
    • landshape.net

In PhotoLine, the Curves dialog box has a gamma slider (the bottom one of the 3 sliders). You can see the changes on the image in real time.

spacediver

  • Newbie
  • *
  • Offline Offline
  • Posts: 6

thanks, good to know. I'm not a photoshop user but might invest in it at some future date.

I use Matlab and would be able to make the transformations that way, but it's nice to know that it's possible to do with existing packages out there.
Logged

Hening Bettermann

  • Sr. Member
  • ****
  • Offline Offline
  • Posts: 945
    • landshape.net

Hi spacediver,

it's not Photoshop, but PhotoLine, and the investment is only 60 Euro. For a private user, that covers both the Mac and the Windows version. It's an amazing program.

Good light!
Pages: [1]   Go Up