cmsj / blacktree-nocturne

Automatically exported from code.google.com/p/blacktree-nocturne
0 stars 0 forks source link

Autodetect and mask large light colored regions #14

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The only issue with Nocturne is that some applications (such as Firefox)
alternate light background content with dark background content. 

The dark content becomes a bright flash and can be very disturbing late at
night. For example, if you close a full screen Terminal it will produce a
bright flash.

One way to get around this would be to detect and mask large regions that
would be rendered as light colored. This would ensure that *all* windows
and displays were dark at all times. I'm not a GUI programmer, but I assume
that you have access to each frame before it's displayed on screen as well
as each window. Pseudocode would then be something like this: 

for each rendered frame
   for each window in that frame
     determine if the window is majority light or dark (simple heuristic
would work)
     if it is majority light, then render as dark using standard nocturne
     if it is majority dark, then it would be *rendered* as light using
standard nocturne. Instead, *refrain* from inverting the colors in this
region so that the normal dark display applies. 

This is a per-frame computation but would be pretty fast -- basically just
summing up the fluorescence in each window before it's rendered. 

An more sophisticated algorithm would actually look at UI elements *within*
each window -- for example, some web sites may have dark borders that
become disturbingly light under Nocturne. What you could do then is segment
the region into clusters of local fluorescence intensity and invert or
leave uninverted as necessary. This segmentation would be tricky to get
fast and right, but it would ensure that Nocturne *never* rendered a large
bright flash. 

Original issue reported on code.google.com by bsr...@gmail.com on 16 Apr 2009 at 1:11

GoogleCodeExporter commented 9 years ago

Original comment by papercr...@gmail.com on 16 Apr 2009 at 11:26

GoogleCodeExporter commented 9 years ago
i was annoyed with Terminal windows being bright when nocturne is activated, so 
i
wrote a ruby script that toggles the themes of each Terminal window before 
activating
nocturne:

http://john.cheslicious.com/projects/nocterm.html

now i need to figure out how to do the same thing with my aquamacs windows, and 
i'll
be golden.

Original comment by mr.ches...@gmail.com on 26 May 2009 at 6:17