
Lumen: Auto brightness based on screen contents - anishathalye
http://www.anishathalye.com/2016/07/31/lumen/
======
userbinator
This is basically a workaround for a problem that I've noticed has affected
laptops for _many_ years --- the ability to set brightness and contrast
independently, despite the fact that desktop monitors have retained both
controls (and more).

 _One big problem with this setup is that my laptop’s backlight is either so
dim that I can’t read the text in my terminal or so bright that I’m blinded by
looking at websites. The problem is especially bad at night._

That suggests the contrast is insufficient. On a monitor with both controls,
this means turning up the contrast while keeping brightness the same or
slightly reduced.

~~~
yiyus
I totally agree independent controls for brightness and contrast would be a
big improvement, but I do not think they would solve this problem. Increasing
the contrast will help you read the grey letters on black background in the
terminal, but then reading black letters in a white background will not be
comfortable.

Personally, I just use a light color scheme for my terminals and keep
brightness as low as possible.

------
ulrikrasmussen
What I'd really like is a 15" E-ink display with a good refresh rate. For
coding and lookup up documentation at night or in the sun, that would be a
pretty good setup.

~~~
Eric_WVGG
Here you go. Not cheap. [https://www.indiegogo.com/projects/paperlike-world-s-
first-e...](https://www.indiegogo.com/projects/paperlike-world-s-first-e-ink-
monitor-13-3#/)

~~~
anowlcalledjosh
Wow. That's incredible - I'm amazed that they've got the refresh rate so low.

~~~
jrockway
I'm guessing they're just using the standard VNC / RDP algorithm that only
sends (ands therefore refreshes) parts of the screen that changed.

It's at best a 150ppi (1600x1200, 2000 pixels along the diagonal over 13")
screen, lower resolution than the original Kindle.

------
MatmaRex
I have a tablet/convertible that does this (Thinkpad Tablet 2) and it's the
most infuriating thing. It doesn't seem possible to turn it off.

~~~
Gracana
My TV does something similar. Best/worst example is if I display a black
console with a blinking white cursor: the backlight flashes on and off from
min to max brightness in time with the cursor. It is an abomination, a gimmick
whose only purpose is to cheat at contrast ratings. If I ever meet the
engineer who came up with this BS, I will stab them with a strobe light.

------
ajnin
The "without Lumen" gif seems edited to make the effect worse. The brightness
is reduced when switching to the terminal, and increased when switching to the
editor. You can see the editor window background getting gray when it slides
off the screen. If you need to be dishonest to "sell" your tool then I'm going
to assume it's not very good.

~~~
rocco_t
I didn't interpret that for dishonesty; he's just trying to illustrate how it
works, in my opinion, by showing a scenario where the screen is too dark for
the content on it, and another scenario where the screen is too bright for the
content on it.

~~~
anishathalye
Yes, exactly. Sorry if it was misleading.

It's hard to demonstrate something that changes your screen brightness,
because brightness changes won't be captured using screen capture software,
and because what people see would depend on their screen brightness setting
too. I could have used a video camera or something to record my computer's
screen, but I thought that would be overkill / not worth the effort, so I just
opted to produce a gif that does an okay job of illustrating the effect.

------
xgbi
I tried and it doesn't work on my MBA on El Capitan 11.6.

There's kind of the same thing on my TV, and it sucks balls.

The changes in brightness is extremely unnerving, especially for action scenes
where the light intensity varies a lot. So it was the first thing I disabled.

So IMHO this won't work that well.

~~~
ulrikrasmussen
Dynamic brightness on TVs was made by manufacturers in order increase contrast
ratios in specs. In practice it is one of the many useless "sales" features,
along with excessive sharpening filters, which has to be disabled in order to
actually use the TV.

That being said, I think the effect will be less unnerving in an interactive
environment where you control the contents of the screen. My phone also
automatically adjusts brightness based on the brightness levels outside, and I
don't find that annoying.

~~~
qu4z-2
"dynamic contrast" is the worst. That said, it looks like this works the
opposite way -- it dims the backlight for mostly-white content, and boosts it
for mostly-black. The fading could still be annoying, but at least it won't
practically turn off the backlight when I switch to a terminal...

------
franciscop
Thank you! This is a big pain point I've had for long time and didn't realize
of the true cause until now. Anyone know of a Linux port? Or any plam to port
it?

~~~
oky
hacked together something for nix using standard tools:
[https://pypi.python.org/pypi/autolux](https://pypi.python.org/pypi/autolux)

can install with 'pip install autolux'. uses imagemagick, xdotool and
xbacklight. please make it better

------
delish
I strongly identify with this problem. I've used "hackervision", a chrome
plugin, for years. It works pretty well.

hackervision inverts website's colors. I'd prefer to read white-text-on-black-
background everywhere. If I start using programs that force a white
background, I'd consider using lumen.

------
grenoire
I've had several laptops with automatic brightness setting like this built
into the monitor/integrated graphics driver. You could not disable it in a few
of those (not even regedit it out), and it was truly the worst thing that I
had ever experienced. Utterly useless, and utterly aggravating.

~~~
anishathalye
It's not useful for certain cases, and it's downright annoying for some, such
as when you're watching video.

For the use case described in the blog post, though, I think it's pretty
useful. I've been using Lumen every day while working, and it's been pretty
helpful to me.

~~~
grenoire
Actually, I don't think it's useful for that case specifically. My example
would be switching between say reddit (very bright UI in default or common
subreddit themes) and my IDEs (using white text over dark background) or
imgur. The brightness increase is generally not noticeable, but the darkening
of bright screens is absolutely obnoxious to me.

The only time I change my brightness is when my laptop is unplugged, or when
I'm using it very late at night with no external light.

Others may prefer the Lumen way, but I wouldn't use it even if I were paid
for.

------
tomglynch
This could be the 2016 version of f.lux

~~~
vanderZwan
I hope they play nicely together.

I also hope there will be a Linux version, that plays nicely with Redshift,
because that's my set-up.

~~~
captn3m0
Working fine on my Mac with f.lux running as well.

I haven't found redshift to play nicely with manual xrandr brightness
adjustments. I've to shut down redshift to just lower the brightness below 1
at night, which sucks (because I lose redshift)

~~~
vanderZwan
You can fiddle about in the config file of redshift a lot, and take control of
gamma, colour ramps and backlight at different times of day. Maybe it's
possible to make it play nice with your set-up too?

I just wish I could save some presets and quickly switch between them from the
GUI, like how I used to use f.lux' ember and darkroom modes for late-night
reading.

~~~
captn3m0
Yes, but not all modes of redshift work across all displays. I decided to take
a look at the redshift configuration[0] just now, and it seems that the newer
versions have some nice config options that might fit my usecase: `gamma-day`,
`gamma-night`, `brightness`, `brightness-day|night`. I should be able to setup
a lower brightness with this for my really late night work.

[0]: [http://jonls.dk/redshift/](http://jonls.dk/redshift/)

------
fit2rule
I wonder what the effect on battery life might be, with Lumen in use
constantly .. like, could this be used to squeeze out another hour of life?

~~~
mszcz
I wondered the opposite - will Lumen "looking" at the screen all the time help
to drain it?

~~~
anishathalye
It probably won't have that much of an impact. It seems to use 0.5-1% CPU on
my computer.

------
z1mm32m4n
My partial solution to this is just to make make Chrome darker, using a plugin
like Dark Reader[1]. It "inverts" the colors on the page but lowers the
contrast so the page still looks pleasant.

That means that my terminal, Spotify, my desktop, and finally Chrome are all
dark at night.

[1]: [https://chrome.google.com/webstore/detail/dark-
reader/eimadp...](https://chrome.google.com/webstore/detail/dark-
reader/eimadpbcbfnmbkopoojfekhnkhdbieeh?hl=en)

------
uyppoppop
some suggestions to deal with the issue OP is describing, using existing
tools;

Night Mode Pro, firefox extension to invert colors of website;
[https://addons.mozilla.org/en-US/firefox/addon/night-mode-
pr...](https://addons.mozilla.org/en-US/firefox/addon/night-mode-pro/)

Stylish, firefox extension to apply styling on sites (make white background
dark): [https://addons.mozilla.org/en-
US/firefox/addon/stylish/](https://addons.mozilla.org/en-
US/firefox/addon/stylish/)

There is more options, for other browsers too. Article:
[http://www.ghacks.net/2015/05/18/turn-any-page-in-a-night-
fr...](http://www.ghacks.net/2015/05/18/turn-any-page-in-a-night-friendly-
version-in-chrome-and-firefox/)

------
supergetting
It seemed to work at first, but now it's no longer working. I restarted the
app, but still doesn't seem to work as described. I like how f.lux turns the
screen close to amber color late at night, but it makes it a little difficult
to read code, and raising the brightness helped, but Lumen sounded like a nice
tool because I may not have to worry about manually increasing the brightness
during nighttime. Oh and when it was actually working in the beginning, I
tested out my two external monitors connected to my macbook, but it didn't
seem to work on them. Anyway, I think the idea behind Lumen is very neat.

~~~
anishathalye
The state of multi-monitor support is unknown (I don't currently have an
external monitor to test on). So I guess it doesn't work for multiple monitors
right now. Sorry about that!

------
Adverblessly
My "solution" looks like this:

    
    
      #!/bin/bash
      for output in $(xrandr --current | grep -e "DVI[^\ ]*" -o)
      do
          xrandr --output $output --brightness $1
      done
    

Bound this script to super+(1-6) for values of 1.0-0.5 and it handles all of
my brightness adjusting needs. 0.5 for "I just woke up" and 1.0 for watching
movies. It obviously isn't automatic, but I personally think that's a
benefit...

And yes, the script could be made nicer, but it works for me, which is enough.

------
therealdrag0
Looks cool.

In a similar vein, I've benefited from using the Dark Reader plugin for
Chrome: It does an excellent job for most webpages. I use it for hackernews,
reddit, youtube, language learning sites, etc.

[[https://chrome.google.com/webstore/detail/dark-
reader/eimadp...](https://chrome.google.com/webstore/detail/dark-
reader/eimadpbcbfnmbkopoojfekhnkhdbieeh)]

------
consto
Shame it's not for Windows

------
auganov
Shouldn't it just downregulate brightness and then slowly crank it back up? I
could not stand anything below full brightness.

Giving up on the cool hacker look and changing my Emacs and Terminal to black
on white is one of the best things I've done. My desktop background is pure
white too.

------
nwmcsween
A fortune for automatic brightness based on legibility of on screen characters
with various global tunables such as average distance from screen and less
than 20/20 vision, as I don't want to make per application profiles for
everything I use.

------
MasterScrat
Doesn't seem to change anything for me. MBPr 15" on OS X 10.9.5.

~~~
anishathalye
Try this:

1\. Start Lumen 2\. Open up a dark window (e.g. a terminal) and make your
display bright according to your preferences 3\. Wait a second 4\. Open up a
light window (e.g. a web browser) and make your display darker according to
your preferences 5\. Wait a second

Now try switching back and forth between the two, and you should see it
automatically doing stuff.

------
iamcreasy
Does anybody know any similar tool for Windows?

------
bdupharm
Thank you.

------
stephane-klein
Thanks! I love this missing tools since many years!

------
throwawy73116
Interesting software, awkward English.

s/contents/content/g

------
sspiff
> This is how Lumen was born. Lumen is a tiny menu bar app for macOS that
> magically sets screen brightness based on screen contents.

I hate it when people replace "automatic" with "magic". It's not magic.

~~~
thaumasiotes
In the wise words of Strong Bad...

"The word 'technology' means 'magic'! It's basically anything that's really
cool that you don't know how it works."

~~~
supercoder
We know how it works, it changes the brightness based on screen contents.

~~~
coldnebo
That's _what_ it does, not _how_ it works.

I.e., 'What' is just the top-level abstraction. 'How' is the functional
composition underneath.

~~~
xbmcuser
No the guy released the source code so you do know how it works as well

