| » Stats |
Members: 104,296
Threads: 85,048
Posts: 1,031,331
Top Poster: Karky (9,549) | | Welcome to our newest member, airjordan4sale | |
If you register for free, you will be able to post threads, vote on polls and lots more. If you have problems with the registration or logging in, please contact the administrator.
 |
06-15-2005, 09:37 PM
|
levels, gamma, and midtone slider Post #1 | | Guest | levels, gamma, and midtone slider
I've just joined and have started using VB for scripting photoshop CS2. I find its guide somewhat lacking and at times wrong. Is there better documentation anywhere without using the object browser?
At the momemt, I also have a need to use levels in my automation and am trying to figure out how photoshop computes gamma from its midtone slider in the levels dialog. I've assumed that gamma relates the output level (y) to the input level (x) in a power function, or y= x^(1/gamma). Assumming that you adjust the black (b) and white (w) points and scale to this new level range (w-b) then I get the following:
gamma = log((x-b)/(w-b)) / log(.5)
That seems to be pretty close to what photoshop does but thought I'd check whether I am missing something?
| |
| |
06-15-2005, 11:49 PM
|
levels, gamma, and midtone slider Post #2 | | Joe Blow
Join Date: Mar 2004
Posts: 4
Rep Power: 0 | levels, gamma, and midtone slider
i like to look at pretty pictures.
oh ya and umm no idea. but if someone knows they will prob be found here. welcome to the board
|
| |
06-16-2005, 02:58 AM
|
levels, gamma, and midtone slider Post #3 | | Guest | levels, gamma, and midtone slider
Gamma is a power function:
output = input^(1/gamma)
That's why the slider is 0 to 1 on one side and 1 to 10 on the other.
Also, the input has to be normalized to the 0 to 1 range before inputting, then output scaled back up.
Oh... I see you have the gamma formula down.
What I recommend is scaling for b and w, then doing gamma.
You know, keep them as seperate operations instead of bunching them together.
This methodology has worked very well for me.
Wait . . . I think I'm thinking backwards to what you are asking.
Colour me confused.
And, from what poking around I've done, the object browser is the only decent way to go.
Everything else I've seen is sometimes unreliable and a messy jumble of poorly organized information.
| |
| |
06-16-2005, 07:55 PM
|
levels, gamma, and midtone slider Post #4 | | Guest | levels, gamma, and midtone slider
Thanks for the confirmation. Now my next step is an attempt to programmatically analyze the histogram and set the gamma. Do you know of any tricks to do this. Many of my 1000s of images I'll be processing are significantly underexposed (but not all and I really don't want to presort things by inspection). I assume you can get a handle on exposure from the median level of the image. My underexposed images also have a sparse (even empty) highlight tail, so its pretty easy to set the white point clipping to .02 to bright things up. But my problem is guessing what the gamma level should be without visual inspection. It seems like the 90th percentile is good starting guess for underexposed images but if you have suggestions for setting gramma knowing the histo array I'd be greatful. Thanks again.
| |
| |
06-16-2005, 09:34 PM
|
levels, gamma, and midtone slider Post #5 | | Guest | levels, gamma, and midtone slider
One way to auto gamma might be to 'half the histogram by count'.
If your image is 20x20, then the total count will be 400.
Start at the high end, move down, and add up the counts.
When you hit 400 / 2 = 200, that is your gamma point.
Make sense?
Or you might be able to use derivatives.
You know, calculus for peaks, delta change, and sigma stuff.
| |
| |  | | Thread Tools | | | | Display Modes | Linear Mode |
More threads of ron_osborn | | Thread | Date | Forum | Replies | Last Post | adjust levels layer
adjust levels layer: I've spent the better part of a day and have not...
| 06-21-2005 | General Photoshop Board | 0 | 06-21-2005 01:49 AM | levels, gamma, and midtone slider
levels, gamma, and midtone slider: I've just joined and have started using VB for...
| 06-15-2005 | General Photoshop Board | 5 | 06-16-2005 09:59 PM |
Other threads in forum General Photoshop Board | | Thread | Date | Thread Starter | Replies | Last Post | Disappearing brush size cursor
Disappearing brush size cursor: Hi , can anyone help with a really irritating...
| 09-22-2007 | olioli | 1 | 09-24-2007 07:25 AM | help please
help please: hope this is the right place to post this, when i...
| 06-23-2007 | Parco | 2 | 06-23-2007 07:24 PM | I would appreciate your help
I would appreciate your help: I am done with my sig in photoshop but I cant...
| 03-22-2007 | Kroo | 2 | 03-22-2007 02:52 PM | Trinidad ans Tobago National Team
Trinidad ans Tobago National Team: Carlos Edwards
...
| 06-11-2006 | pauleta.48 | 1 | 06-11-2006 07:11 AM | Garrincha, The Wizard
Garrincha, The Wizard: http://www.youtube.com/watch?v=P9yd6r-1EDo
:)
| 05-30-2006 | Leon | 1 | 05-31-2006 10:41 AM | | » Online Users: 22 | | 0 members and 22 guests | | No Members online | | Most users ever online was 2,128, 07-21-2008 at 08:27 PM. | |