Mobile app version of vmapp.org
Login or Join
Pope1402555

: What's the math behind gamma in GIMP? Inside GIMP, Colors -> Levels Click on the "Pick gray point" eyedropper (the middle eyedropper) and then click on a pixel in the image. Then go change to

@Pope1402555

Posted in: #Gimp #Rgb

Inside GIMP, Colors -> Levels
Click on the "Pick gray point" eyedropper (the middle eyedropper) and then click on a pixel in the image.
Then go change to the Red/Green/Blue channels and you'll see that the gamma (middle triangle) is set to a float for each RGB channel.

What's the math behind this? Like if I know the RGB values of a pixel how do I calculate to get these 3 gamma numbers myself.

I want to write a script-fu that sets levels based on black/white/gray points.
black and white points are straight forward, but this gray point deals with gamma and that's what's stopping me.

Thanks in advance!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Pope1402555

1 Comments

Sorted by latest first Latest Oldest Best

 

@Megan533

I think you may be best off looking for something like an RGB to HSL conversion if you're looking for true luminance values (see this article for more on why it's not as straightforward to figure this out as one would think).

The other thing you could try would be going for a grayscale value; this site (among others) allows you to convert from a hex value to a grayscale (among other) value. This second approach would be simpler but not necessarily as accurate (although I would think that this level of accuracy should be fine for most applications).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme