Hacker News new | comments | show | ask | jobs | submit login
Lumen: Auto brightness based on screen contents (anishathalye.com)
182 points by anishathalye 498 days ago | hide | past | web | favorite | 62 comments



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.


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.


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.



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


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.


Lag between keypresses and screen response would infuriate you, probably.


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.


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.


My old Nexus 7 (2012) had a similar feature called PRISM/SmartDimmer which was equally annoying, though it could be disabled via sysfs. Many people did not notice it though, so maybe it was a net win...


There is no way that you can't turn it off, I find it highly doubtful that they do this in hardware with some ASIC that reads the display buffer in the LCD and averages the color of the screen from there. It's more than likely uses the screen brightness API that was introduced with Windows 8 which talks to things like colorimeters and light sensors.


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.


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.


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.


It's just to illustrate what it does no?


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.


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.


"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...


Your phone probably doesn't vary brightness based on screen contents.


I think you are being too dismissive. I agree that it doesn't work too well for videos. But if I am jumping between a dark terminal or IntelliJ screen and a web browser with white background, this would be perfect. Look at the gif posted in the submission.


This kind of thing was baked into the Linux driver for the AMD Radeon HD6310 on a netbook I bought in 2010. It was very unpleasant and impossible to disable. Later drivers did not seem to have that feature.


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?


hacked together something for nix using standard tools: https://pypi.python.org/pypi/autolux

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


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.


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.


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.


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.


I have an LG display with this anti-feature built in as well. An amusing anecdote about that: The OSD is not documented very well. There's a feature named “SUPER ENERGY SAVING” and a feature simply named “DFC”. As I learned via google, “DFC” is supposed to mean “Digital Fine Contrast”.

Now, about these two features: One of them turns off the backlight when I lock my screen, the other adjusts the backlight intensity automatically based on the display contents.

Did you think “SUPER ENERGY SAVING” was the first and “DFC” was the second? Nope, of course not - it was the other way around. “SUPER ENERGY SAVING” advertises itself as “saving energy” by reducing the backlight intensity when it's “not needed as much”, and “DFC” advertises itself as increasing the “dynamic” contrast (by basically turning off the backlight during the black frame test pattern).

Good job LG. This is actually one of the least sad bits about the OSD's horrible design and implementation.


Had to send back a Dell XPS 13 for this exact reason. Unbelievably annoying.


Absolutely true. The biggest hindrance was when playing games, the screen would become washed out.

Another would be when switching between sublime and stackoverflow.

I found a fix though(For dell laptops only). If you disable this via the intel video settings screen and you're plugged in to a power source, just remove and reattach the power cable and your screen should be fine.


This could be the 2016 version of f.lux


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.


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)


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.


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/


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?


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


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


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...


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...

Stylish, firefox extension to apply styling on sites (make white background dark): 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...


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.


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!


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.


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...]


Shame it's not for Windows


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.


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.


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


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.



Does anybody know any similar tool for Windows?


Thank you.


Thanks! I love this missing tools since many years!


Interesting software, awkward English.

s/contents/content/g


> 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.


At least go with automagically, which I take to mean that the mechanism is programmed, but it took some arcane steps to get the damn thing working


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."


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


That's what it does, not how it works.

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


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


It's the influence of Apple marketing.


It was always my understanding that in programming "magic" is just a shorthand for "I don't feel like explaining the implementation in that much detail right now".

The Jargon File defines it similarly: http://catb.org/jargon/html/M/magic.html




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: