Gamma?

BlitzMax Forums/BlitzMax Beginners Area/Gamma?

xlsior(Posted 2005) [#1]
One thing I notice when trying my win32 blitzmax program-in-progress on my two different computers, is that there is a huge difference in the coloring on both systems.

On one things look 'right' (sprite colors more or less matches the colors as they looked in photoshop) while on the other system things look *much* darker.

Which got me searching for a command to set the Gamma Level... But so far I'm coming up empty.

Are there any built-in functions to adjust the gamma?
If not -- are there any plugins or workarounds that can do this?


Steve Elliott(Posted 2005) [#2]
I guess you could draw a white rectangle over the screen and turn the alpha up and down.


Beaker(Posted 2005) [#3]
That is not gamma.


xlsior(Posted 2005) [#4]
While this code does brighte up a screen, it is not true Gamma -- your example applies a linear correction to an image, rather than adjusting the shape of the curve for the color distribution like true gamma would.

In this example, all of the lightest colors would be substituted by pure white, while a gamma corrected image would still be using seperate colors, they would just be closer together.

That said: This sure is better than nothing at all, although I wonder if there is some kind of global openGL modifier that can apply a real gamma, without needed to 'waste' the additional resources by drawing a seperate full screen image...

Thanks for the suggestion though.


Beaker(Posted 2005) [#5]
You can do it on Windows using the GetDeviceGammaRamp() and SetDeviceGammaRamp() methods from Gdi32.lib. More here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/icm/icm_8ckw.asp

No idea how you might do it on Mac and Linux tho.


Steve Elliott(Posted 2005) [#6]

That is not gamma.



Yes I know it's not gamma - just a quick fix (at very low alpha) that came to mind.


xlsior(Posted 2005) [#7]
Any chance there will be a built-in SetGamma command at some point, like in B+ for example?


ImaginaryHuman(Posted 2005) [#8]
Convert your image in your paint software to an appropriate level of gamma just before saving so that when it loads in it is correct.


xlsior(Posted 2005) [#9]
Convert your image in your paint software to an appropriate level of gamma just before saving so that when it loads in it is correct


that's not the issue: the image is perfectly fine on my primary computer, but way to dark on another one.

If I brighten the image itself so it looks good on computer #2, it will simply look too light & washed out on computer #1, not fixing the issue.

Gamma correction by the program itself is the only real solution, since it will allow a user to adjust the brightness of the images look OK on his/her computer.


Steve Elliott(Posted 2005) [#10]
Perhaps there's an OpenGL solution to this - if not lets pester Mark for a gamma function.


xlsior(Posted 2005) [#11]
That's what I'm trying to find out. :-/


{cYan|de}(Posted 2005) [#12]
setup your monitor correctly and video card driver color settings:P


xlsior(Posted 2005) [#13]
setup your monitor correctly and video card driver color settings:P


My main computer is, and the backup one is calibrated just fine on the desktop... But full screen 3D on it is an order of magnitude darker, with no driver options to adjust the coloring in 3D mode. :-P