-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDR support #97
Comments
Odd. I have an HDR monitor and the brightness slider works fine. I have no idea what controls that "HDR/SDR" bar and I don't think it affects true HDR content. Only SDR. I would assume the registry controls it, but I can't find any documentation on where/how it's stored. |
This doesn't really help: https://support.microsoft.com/en-us/windows/hdr-and-wcg-color-settings-in-windows-10-2d767185-38ec-7fdc-6f97-bbc6c5ef24e6 |
I haven't found much on my own either. Without access to a bunch of HDR monitors, I don't know that I'll be able to do much about this. In a future update, I'll allow users to exclude their monitor from Twinkle Tray. So at least HDR displays can be excluded. If anyone can provide DDC/CI information about their own HDR display, documentation about adjusting HDR programmatically, or a PR for this feature, it would be greatly appreciated. |
@xanderfrangos I just dug through procmon when making the HDR toggle and can't find anything that stands out.. it's very chatty at about 47k lines in just a few seconds. If there's anything I can look for, LMK. Also, how can I provide you DDC/CI info? I've got two HDR compatible displays from different major manufacturers. |
relevant issue here: couldn't reset back to normal mode brightness after turning on & off HDR mode (not the windows fake one but the true HDR mode in a game or a movie), |
Also would like to see HDR support added if possible. Makes the app unusable because I like to keep Windows HDR enabled. |
I recently upgraded to Windows 11 and the brightness control of my HDR monitor stopped working. As soon as I turn off HDR, it works again. Even the v1.14-beta1 version does not allow the control that the stable version did on Windows 10. |
Ok I've found the registry key that the setting changes (tested on Win 11).
The value is from 1000 (0%) to 3500 (50%) to 6000 (100%) in dec. Once the I hope this is somewhat useful. |
@wywywywy That might actually help. Thanks! The only HDR display I have at the moment seems to control HDR brightness via DDC/CI, which is not normal. So someone else will have to look into this further for now. |
It appears that every 1000 equals 80 nit, although I kind of question that because my screen is supposed to be 400 nit max rather than 480 nit. Anyway I found out how to get the SDR balance through the Win32 API. I think that to be able to set the SDR balance we'll have to make a call to the display driver. Data structure: https://docs.microsoft.com/en-us/windows/win32/api/wingdi/ns-wingdi-displayconfig_sdr_white_level Get: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-displayconfiggetdeviceinfo Set: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-displayconfigsetdeviceinfo |
@xanderfrangos Brightness of SDR content can be controlled programatically (see my answer here), HDR brightness cant be controlled by "design". |
That's great! Thank you for sharing. I'm not sure when I'll have a chance to look into this again, but it's great to finally have a working example. |
For HDR brightness control, you could adjust the (reported) peak luminance in color profile, but that is a hacky solution at best and most HDR applications and games ignore that anyway and roll their own brightness calibration. I've also left some more info that may be relevant on the issue over at Monitorian, see link above. |
thats just your monitor. it depends on the specific monitor. For example on my samsung oddysey, I can control the screen brightness in the OSD menu when HDR is on |
IMO, this is super complicated and while it would be lovely to fix in the future. I don't think it would be worth the immediate effort. Dev time is precious. Let's consider the use-case scenarios. I mainly want HDR to operate how f.lux works [disable for full-screen apps] (in reverse). Enable HDR when full-screen apps are running. Disable when not (use brightness control). HDR would now auto-enable (and f.lux would auto-disable) at the same time when I launch a game or a movie in full-screen. This solves a few things:
My 2cents Thanks for awesome software! |
I don't agree. Implementing the HDR on-off switching properly and correctly is not simple either and i don't think it requires less resources to implement. Besides that, why would you want to limit HDR to fullscreen (games)? YT and other platforms can deliver HDR content just fine, i might want to watch some content in one window while doing other stuff in another. Just straight up dismissing windowed HDR content seems a little too far. Having what you propose is better than nothing, but it's only a workaround and doesn't really solve the original issue imo (not being able to control SDR brightness with HDR enabled). |
@xanderfrangos I am starting to work on adding HDR support (unless you are already doing that?). Let me know what you think about this. |
@lulle2007200 I'm not actively working on it. A PR for it would be very welcome. Are you working off the master or beta branch? In the beta branch I've added more code related to dynamically adding user-controlled sliders per-monitor. It might make sense to piggyback off of that instead of having it use separate logic/UI/settings for just the one slider. The HDR (well, SDR-in-HDR) slider could also replace the brightness slider and work off the existing "linked levels" and "normalize brightness" features. Either way, I'm sure the feature would make several users happy. If you can get the code for updating the SDR brightness working per-display, I can get it wired up to the UI if needed. |
Yeah, i am on the beta branch.
Im currently researching how to do that. If it is possible to set per monitor, it'd make sense to just replace the slider for HDR monitors. |
Hey, having this feature would be awesome, how is it coming along? Maybe I'll have a look at it too. In the meantime, I wanted to point out that there is a script here that is adjusting sdr 'brightness' over multiple monitors if that helps |
Some dev posted yesterday info about an undocumented Windows 10/11 API allowing to change SDR brightness on HDR display here: https://stackoverflow.com/a/78435051/1054589 |
When I switched to HDR monitors, I was shocked to find out that this hadn't been implemented yet :( |
Finally figured out how to do it properly.
To update the brightness when the user moves the brightness slider, you'd use Windows hard-limits the SDR white level to 480 nits internally, When i have some more time, i'll implement it. Note: both of these are undocumented. |
Also,
Auto HDR can be toggled with:
to enable/disable auto HDR:
|
I recommend everyone to check out this repo https://github.com/ledoge/set_maxtml, I tried other scripts that set the sdr brigthness in differrent ways but they were always buggy. I then made an auto hotkey script with a schedule, transitions, hotkeys and I made it pause for fullscreen apps (I like it for playing games or watching movies) #Requires AutoHotkey v2.0
#SingleInstance Force
; Schedule entries with brightness levels directly
SCHEDULE := Map()
SCHEDULE["08:00"] := 480
SCHEDULE["12:00"] := 400
SCHEDULE["15:00"] := 320
SCHEDULE["19:00"] := 240
SCHEDULE["21:00"] := 160
SCHEDULE["22:00"] := 80
; Variable to store the resume time
ResumeTime := 0
; Convert time string to minutes since midnight
TimeToMinutes(time) {
parts := StrSplit(time, ":")
return parts[1] * 60 + parts[2]
}
; Get the current time in minutes since midnight
GetCurrentTime() {
return A_Hour * 60 + A_Min
}
; Check if any window is in fullscreen mode
IsFullscreen() {
activeWindow := WinGetID("A")
/*
WinGetPos(&winX, &winY, &winWidth, &winHeight, activeWindow)
screenWidth := A_ScreenWidth
screenHeight := A_ScreenHeight
return (winWidth >= screenWidth and winHeight >= screenHeight)
*/
winStyle := WinGetStyle(activeWindow)
; WS_CAPTION = 0xC00000 WS_SIZEBOX = 0x40000
if (winStyle & (0xC00000 | 0x40000)) {
return false ; It's not borderless
}
return true ; It's borderless
}
; Set brightness level
SetBrightness(value) {
; Using 0 as the monitor index will apply the SDR white value to all monitors.
RunWait(".\set_maxtml\set_sdrwhite.exe 1 " value, , "Hide")
}
; Interpolate brightness between two times
InterpolateBrightness(currentTime, prevTime, nextTime, prevBrightness, nextBrightness) {
; Ensure the interpolated brightness is divisible by 4
return Round((prevBrightness + ((currentTime - prevTime) / (nextTime - prevTime)) * (nextBrightness - prevBrightness)) / 4) * 4
}
; Set brightness based on schedule
SetScheduledBrightness() {
if (GetCurrentTime() < ResumeTime || IsFullscreen()) {
; Schedule is paused or fullscreen is active, do nothing
SetTimer(SetScheduledBrightness, 600000) ; Check every 10 minutes
return
}
currentTime := GetCurrentTime()
previousTime := -1
previousBrightness := 0
nextTime := 1440 ; Default to end of day
nextBrightness := 0
for time, brightness in SCHEDULE {
scheduleTime := TimeToMinutes(time)
if (scheduleTime <= currentTime && scheduleTime > previousTime) {
previousTime := scheduleTime
previousBrightness := brightness
} else if (scheduleTime > currentTime && scheduleTime < nextTime) {
nextTime := scheduleTime
nextBrightness := brightness
}
}
; Interpolate if there's a next scheduled time
if (nextTime != 1440) {
brightness := InterpolateBrightness(currentTime, previousTime, nextTime, previousBrightness, nextBrightness)
SetBrightness(Round(brightness))
} else {
SetBrightness(previousBrightness)
}
SetTimer(SetScheduledBrightness, 300000) ; Check every 5 minutes
}
; Apply the brightness level based on the previous scheduled time when the script starts
SetScheduledBrightness()
; Set manual brightness and pause schedule for 2 hours
SetManualBrightness(value) {
SetBrightness(value)
ResumeTime := GetCurrentTime() + 120 ; Pause for 2 hours
if (ResumeTime >= 1440) {
ResumeTime -= 1440 ; Adjust for overflow past midnight
}
}
; Resume schedule immediately
ResumeSchedule() {
ResumeTime := 0
SetScheduledBrightness()
}
; Hotkeys for manual brightness setting
^!1::SetManualBrightness(80)
^!2::SetManualBrightness(160)
^!3::SetManualBrightness(240)
^!4::SetManualBrightness(320)
^!5::SetManualBrightness(400)
^!6::SetManualBrightness(480)
; Hotkey to resume the schedule immediately
^!0::ResumeSchedule() |
Tested and this works 100% to adjust SDR brightness and displays changes in the OS SDR settings too. |
Hi all, I've started adapting https://github.com/ledoge/set_maxtml for Twinkle Tray. So far I only have the SDR brightness sliders working. It's still early, but I wanted to make sure it's working as expected. I don't have a display to properly test this with. Give this build a try if you have an HDR monitor: https://github.com/xanderfrangos/twinkle-tray/actions/runs/11227334110/artifacts/2027121771 You can enable the SDR brightness slider from |
@xanderfrangos thank you for putting in the work to support HDR, the new builds HDR Slider works perfectly but it does not seem to change from using hotkeys or time adjustments and DDC/CI still is required to be on for the display to appear (which isn't necessary for HDR SDR Brightness), I usually keep DDC off because my Display locks most OSD Options in HDR Mode and when I change them outside the OSD, the Displays Colors become weird. |
This is working perfectly fine on my Huawei GT 27" display on a Windows 11 24H2 build running on an RX7900XTX! Everything that you mentioned just works 🔥 I've waited so long for a feature like this! Now the only thing left is time of day adjustments support, a way to disable the normal brightness slider and only have the HDR slider shown and it would be perfect! 🙌 |
In version 1.16.2, the entry point for this feature cannot be found. |
HDR isn't yet an official feature. Only the build I posted 2 days ago (partially) supports it right now. There's a lot of work to be done still, so don't expect any official releases to include HDR soon. |
Just downloaded and tried the build from the link. works great so far. thank you! looking forward to setting it via scroll wheel on the tray icon again one day, but for now this'll do just fine. |
The download link is dead. Can you please or anyone who downloaded it already re-upload? |
The link should still work if you're signed into GitHub |
sorry, I had to login to comment and didn't realize this was my issue. I understand there's still no hotkey support? |
When HDR support is enabled, brightness control on my monitor is disabled.
Instead, the following slider can control brightness of SDR apps, which acts like a 'pseudo' brightness bar.
Twinkle tray's brightness control in this scenario should either
Right now I can mess around with the brightness slier in Twinkle tray, but it looks like it's corrupting my monitors brightness setting (which are disabled) and has the ability to completely turn off my monitor at setting 0%, and in general doesn't look like it's doing the correct thing and possibly corrupting some state. I had to restart my monitor to reset settings back.
The text was updated successfully, but these errors were encountered: