UnseededAndroid
UnseededAndroid

Reputation: 567

Formula to increase brightness of RGB?

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?

Upvotes: 10

Views: 18657

Answers (1)

Innuendo
Innuendo

Reputation: 671

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.

Upvotes: 4

Related Questions