How to calculate output values in gamma (was: Gamma)
How to calculate output values in gamma (was: Gamma)
- Subject: How to calculate output values in gamma (was: Gamma)
- From: Marco Ugolini <email@hidden>
- Date: Thu, 26 Jul 2007 00:51:31 -0700
- Thread-topic: How to calculate output values in gamma (was: Gamma)
A note for those like me who are no math wiz, but enjoy getting their hands
on the math behind gamma calculations using Excel:
The gamma curve can be viewed by plotting onto a chart the numerical results
(outputs) of raising the numerical value of the input to the power indicated
by the gamma value (for example, 2.2).
So, we can spell out the equation this way:
[Output number] = [Input number] ^ Gamma
Which reads:
"The output number equals the input number to the power of the gamma value"
If you use Excel, the formula is of the type:
=POWER(A1,2.2)
where "A1" is the spreadsheet cell (could be *any* cell) with the input
number, and "2.2" is the gamma value (in this case 2.2), which is the power
to which the input number must be raised to obtain the output number. The
resulting number is the output's numerical value (which, with a positive
gamma value, will be smaller than the input value, with the exception of the
endpoints, which will both match).
An intermediate step will be needed to obtain this result, though: since the
endpoints will not change in a power functions only if the range is between
0 and 1 (because both 0 and 1 always remain 0 and 1 no matter what power
value is applied to them), the input range must be first normalized. That
way, the resulting curve will always have a lowest value of 0 and a highest
value of 1, no matter what the gamma value is applied to the input. Which is
to say that the curve shape changes along with the gamma value (steeper as
the gamma value increases), but the endpoints do not move.
So, if you have a range between 0 and 255, as is the case in an 8-bit
scenario that has 256 steps, first normalize the input by dividing 1 by 255.
Then create a sequence of 256 consecutive numbers between 0 and 1 in steps
of 1/255. Finally, apply the power function to each normalized numerical
input value, using the power indicated by the gamma value.
The final step before plotting the curve will be to multiply the output
numbers by 255 to obtain the actual values from 0 to 255 in the 8-bit
output, which in turn will always be rounded up to the nearest integer.
A bit complicated, but I hope I explained it clearly enough.
In a message dated 7/25/07 10:54 AM, Andrew Rodney wrote:
> When describing the response of a system, the correct statement would be,
> ³My scanner has a TRC of gamma 1.8,² instead of, ³My scanner has a 1.8
> gamma.² It seems like silly semantics but it¹s useful to understand.
Or could one say: "My scanner's TRC is gamma 1.8"? That would imply that
one's scanner's TRC follows the contours of a gamma 1.8 curve exactly, or at
least very closely.
Marco Ugolini
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Colorsync-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >Re: Gamma (From: Andrew Rodney <email@hidden>) |