Author Topic: Altering gamma under Linux  (Read 21751 times)

nalf

  • Posts: 26
  • Turrets: +1/-0
Altering gamma under Linux
« on: February 09, 2012, 09:38:35 am »
Somebody asked yesterday how to alter gamma on GPP under Linux. Apparently, the menu option doesn't work. I googled somewhere that it can be done by the xgamma command line tool. For example
Code: [Select]
xgamma -gamma 1.7and setting it back to normal:
Code: [Select]
xgamma -gamma 1It changes the whole Xorg system though, so all applications are affected.
One can use a simple shell script to start GPP with altered gamma:
Code: (shell) [Select]
#!/bin/sh
xgamma -gamma 1.7 # alter the value to your needs
trap "xgamma -gamma 1" EXIT
# change the path to your tremgpp installatin
~/game/tremulous/tremulous-gpp.x86 "$@"

I found some other tools that possibly allow to change brightness and contrast: DDCcontrol, xvattr, but they don't work for me (depends on a graphics chip/driver I suppose). If you have better luck, let others know.

And there is also another program Redshift that alters automatically perceived display color depending on current daytime. Can help strained eyes if playing/working too long.

Update: I found out that gamma can be also corrected by the xrandr tool. It allows to change both gamma and brightness. First  query your configuration by
Code: [Select]
xrandr --queryand then alter the parameters for your selected output (mine is LVDS):
Code: [Select]
xrandr --output LVDS --gamma 0.5:0.5:0.5 --brightness 1.5and set it back
Code: [Select]
xrandr --output LVDS --gamma 1:1:1 --brightness 1The brightness correction is only software based, as the documentation says:
Quote
However,  this  is a software only modification, if your hardware has support to actually change the brightness, you will probably  prefer  to  use xbacklight.
« Last Edit: February 09, 2012, 10:02:34 am by nalf »

Qrntz

  • Posts: 847
  • Turrets: +204/-12
Re: Altering gamma under Linux
« Reply #1 on: February 09, 2012, 12:47:15 pm »
It's better to just specify
Code: [Select]
--output default
in the XrandR command line.
This way it manages whatever display is your current one.

You make up Qrntz, u always angry, just calmdown. :police:
I am stupid idiot who dares to open mouth and start debating

Tremulant

  • Spam Killer
  • *
  • Posts: 1039
  • Turrets: +370/-58
Re: Altering gamma under Linux
« Reply #2 on: February 09, 2012, 06:59:35 pm »
It's better to just specify
Code: [Select]
--output default
in the XrandR command line.
This way it manages whatever display is your current one.
Assuming it happens to actually be called "default"? or does this actually work as you suggest in more modern versions of xrandr than i've got?
my knees by my face and my ass is being hammered

Qrntz

  • Posts: 847
  • Turrets: +204/-12
Re: Altering gamma under Linux
« Reply #3 on: February 10, 2012, 02:19:04 am »
It's better to just specify
Code: [Select]
--output default
in the XrandR command line.
This way it manages whatever display is your current one.
Assuming it happens to actually be called "default"? or does this actually work as you suggest in more modern versions of xrandr than i've got?
Yes, this actually modifies the default output, be it VGA, LVDS, TV or else. My version is 1.3.2 and I just checked if this still works (it does).
I don't ever use xrandr for gamma correction though, for
1) I am lucky enough to not need gamma correction
2) it doesn't play nice with the nvidia proprietary drivers, which stopped bothering about xrandr's existance since it was 1.1. See:
Code: [Select]
xrandr: Failed to get size of gamma for output defaultPeople with proprietary nvidia drivers should use the nvidia-settings app to tweak gamma.

You make up Qrntz, u always angry, just calmdown. :police:
I am stupid idiot who dares to open mouth and start debating

Little*Butterfly

  • Posts: 19
  • Turrets: +0/-1
Re: Altering gamma under Linux
« Reply #4 on: February 29, 2012, 11:25:45 am »
Hi,

Try this in the console

/r_ignorehwgamma 1
/r_gamma 2.0

Try 0 and 1 for r_ignorehwgamma