mlaily / NegativeScreen

NegativeScreen is a Windows application allowing you to invert your screen colors. (and more)
https://zerowidthjoiner.net/negativescreen
GNU General Public License v3.0
169 stars 20 forks source link

Negative per window #5

Open rajsinghUSA opened 7 years ago

rajsinghUSA commented 7 years ago

Is it possible for NegativeScreen to work on a per-window basis? I have many apps and webpages that use dark/night mode on their own, but certain apps on Windows don't have an option for dark/night theming.

Would it be possible to implement NegativeScreen on particular windows within Windows? For example, a particular shortcut key that will only enable NegativeScreen on the currently focused/active window.

Also, thank you for this awesome app, it's seriously indispensable for me and one of the first items installed on any new computer of mine.

mlaily commented 7 years ago

It is technically possible to only invert a rectangle and not the entire screen, but generalizing that to invert a specific window, while properly handling the currently in focus window, potentially overlapping windows, etc, would be a lot of work. Also, windows are not necessarily rectangular, so this would be an (admittedly rare) problem. I'm also not quite sure the performance would be great.

myfairsyer commented 7 years ago

So closing this means wontfix?

mlaily commented 7 years ago

I guess, or at least most likely wontfix, as I don't see a practical way to implement this feature properly, and I don't plan to spend time to research it.

Since I see how having this feature could be useful, maybe I shouldn't have closed the issue though. I will reopen it. Having it still open will hopefully prevent future similar questions...

evbo commented 5 years ago

@rajsinghUSA this isn't what you're looking for, but you might agree that the next best thing for now is to invert monitors independently and this older version does just that:

https://0.x2a.yt/other/private/NegativeScreen-custom-multi-monitor.exe

It's a tad bit slower, but I'm also like you and need to toggle inversion on a per window basis. Simply put all your windows that don't need inversion on one monitor screen (assuming you have more than 1) and when you right click on the tray icon you can toggle inversion off for that monitor.

Runs for me great on Windows 7 with 8 GB ram and an i5 processor

lightile commented 5 years ago

I tried this tool, but once I open it, it dumped.

KaKi87 commented 4 years ago

Hello, is still not doable on Windows 10 ? Thanks

mlaily commented 4 years ago

There is no relation between this feature request and Windows 10 (or other versions of Windows).

KaKi87 commented 4 years ago

Well, the website screenshots are Windows 7 screenshots so I thought maybe you didn't checked if the API would've been improved between 7 and 10.

Sogolumbo commented 4 years ago

I think there's a way to implement this feature:

mlaily commented 4 years ago

Ok but again, what happens when your target window is not focused? When windows overlap?

Actually, what is the purpose of the requested feature?

I don't think it can work very well in a multi-tasking workflow, but maybe that's not actually necessary. It could work with only a few side by side windows, if they are not overlapping, but the magic would break as soon as windows overlap.

Would it fit the bill to ignore windows, and instead have the ability to define rectangular areas on the screen, each with a specific filter?

KaKi87 commented 4 years ago

what is the purpose of the requested feature?

Making light apps dark without making already dark apps light.

Sogolumbo commented 4 years ago

The goal for me is multi-tasking. (E.g. splitscreen).

If we want to calculate complicated setups that's entirely possible: We can discribe Windows as rectangles and find out if they overlap. If they do we subdivide the area of the back window into (1,2, or more) smaller rectangles that are not overlapped. I think that would be a pretty fast calculation. And we don't have to support an infinite amount of windows. We could specify a maximum in the config file, which provides fast speed and still covers the main use cases.

It is possible to find out the order of the windows, right?

Btw: this feature is very important to me. There's a sickness called ME/CFS which, beneath many horrible symptoms, can cause increased sensitivity to light. Someone close to me has this illness and has problems with some programs that don't allow him to change their color and asked me for help. I have some experience with C# developing and I'm willing to invest time on this. I haven't looked at the code yet, I'll start on monday.

rajsinghUSA commented 4 years ago

How is this guy able to invert color on a per-window basis with AutoIt? https://github.com/gileli121/WindowTop

KaKi87 commented 4 years ago

Well, thank you for sharing this tool with us, I'm going to try right away.

mlaily commented 4 years ago

How is this guy able to invert color on a per-window basis with AutoIt? https://github.com/gileli121/WindowTop

Mmh, not sure, but it might be using https://docs.microsoft.com/en-us/windows/win32/api/magnification/nf-magnification-magsetwindowfilterlist ... (I think all the interesting source code removed is mostly still present in the first commit of the linked repo)

Honestly, I'm more impressed by this: https://youtu.be/SkOq3-jjGf4 (Not the auto-toggle, but the part where images stay normal)

KaKi87 commented 4 years ago

Wow, that software is awesome. Thanks @rajsinghUSA for sharing.

@mlaily Are you going to port this software's features into FLOSS ? :)

PS : regarding web browsing, you'd better use Brave which natively supports dark window colors, and the Dark Reader extension, which smartly force-dark websites.

mlaily commented 4 years ago

@mlaily Are you going to port this software's features into FLOSS ? :)

I'm not interested in most features, but the ones related to dark mode might be a good fit if I can find a way to implement them reliably...

PS : regarding web browsing, you'd better use Brave which natively supports dark window colors, and the Dark Reader extension, which smartly force-dark websites.

I don't want to use Brave, but I have some dark mode extensions for Firefox and Chrome. They work well, but only in the browser.

KaKi87 commented 4 years ago

the ones related to dark mode might be a good fit if I can find a way to implement them reliably

That's the only ones I also care about actually. But the other software is reliable, really. Multi-DPI is the only issue to be fixed.

Sogolumbo commented 4 years ago

I think he's also using the magnification api of windows. When moving the windows in his app you can see that the dark windows lag behind a little bit. Also when you select dark mode in a maximized window he will invert the whole screen (including the task bar).

Sogolumbo commented 4 years ago

I just went through the history and saw 53ae0fa. It seems like at that point you were just a function call to MagSetWindowFilterList away from having window specific color inversion.

Edit: Well, I tried to call MagSetWindowFilterList, turns out that won't give us any desireable results: The windows which are excluded from the filter will just be rendered invisible (instead of being shown normally). Here's the branch.

Sogolumbo commented 4 years ago

@mlaily Now I think I understand your conerns about non-rectangular and overlapping windows. I do think that it would make sense to do something similar like in 53ae0fa where there's a magnifierControl for every screen. Just instead of one window per screen we can cover exactly the area that we want by using multiple dynamically sized magnifier windows:

We can discribe Windows as rectangles and find out if they overlap. If they do we subdivide the area of the back window into (1,2, or more) smaller rectangles that are not overlapped.

Do you think that would work?

Btw I just wanted to tell you I have a lot of respect for all the work you have put into this project.

mlaily commented 4 years ago

Do you think that would work?

It would work in theory, but I don't think having too many magnifier surfaces is a good idea, and I don't want to go this route. You are free to try!

kmantel commented 2 years ago

I found this post from this thread using autohotkey in case anyone is still watching this. It looks like it uses MagSetColorEffect.