Formula to increase brightness of RGB?

UnseededAndroid picture UnseededAndroid · Jun 20, 2018 · Viewed 7.4k times · Source

Quick question!

I have an R G B value and I want to convert to convert it to be 50% brighter. I found a gamma formula but I'm unsure if gamma is the correct way to go.

So far, I'm using:

        r = 255*((R/255.0)^ (1/1.5));
        g = 255*((G/255.0)^ (1/1.5));
        b = 255*((B/255.0)^ (1/1.5));

All I'm doing is multiplying the gamma by 1.5. The image does look brighter, but I'm unsure if its actually 50% brighter or if the formula I'm using is wrong. Is this correct?

Answer

Innuendo picture Innuendo · Jun 20, 2018

Literally "make it 50% brighter" is this

r = min(255, r*1.5)
g = min(255, g*1.5)
b = min(255, b*1.5)

You can also transform RGB to HSV map, increase the V [value] and reconvert it again to RGB.