Jump to content
  • Advertisement
Sign in to follow this  

Gamma Midpoint/Offset ?

This topic is 2041 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,


I'm trying to implement a Levels algorithm like Photoshop. I think I have it all figured out except for one thing.


If the black and white points are 0.0 and 1.0 the midpoint is 0.5 and the gamma at that point in 1.0. The problem I'm having is if the midpoint is at (say) 0.375, how do I make it so that midpoint has a gamma of 1.0 ?


I'm doing it like this:


v=pixelValue // (0...1)
if(v < a)
else if(v > b)
 v=gamma(v); // the midpoint between a and b has a gamma of 1.0


Thank you.



Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!