dylanraga / win11hdr-srgb-to-gamma2.2-icm

Transform Windows 11's virtual SDR-in-HDR curve from piecewise sRGB to Gamma 2.2
436 stars 11 forks source link

Are you planning to finally release a tool that lets us make our own? Or is this abandoned? #31

Closed DitherMan420 closed 10 months ago

DitherMan420 commented 11 months ago

Just wondering if you still plan on making a tool that lets use change the peak nits? Otherwise, can you please just simply upload a bunch of versions, ranging from like 400 to 1500? Please?

ABDX80 commented 11 months ago

@dylanraga Any updates bro? Using the tutorial post is just too complicated for noob users. Or maybe make a YT video on it?!

Animesh-Does-Code commented 11 months ago

Personally I use this autohotkey script by mspeedo, which does not change the peak nits reported to Windows and uses the value from your monitor. You can disable it on the fly for real HDR content, which should have this tonemapping fix disabled anyway as it can cause crushed blacks. After you've installed and configured the prerequisites, download the pastebin text file and change its extension to ".ahk" instead of ".txt" to be able to run it.

You just need to edit the script file and change "whiteLuminance" to the equivalent nits value as your preferred Windows "SDR content brightness" value, like shown here:

Windows SDR content brightness at 100 (480 nits)

I've set whiteLuminance to 480 in that image because my SDR content brightness was set to 100, which is equivalent to 480 nits SDR brightness. (Refer to this handy table to find out what nit value you should use for whiteLuminance)

SDR content brightness value

I also highlighted the "gamma" setting too since you might want to change that to something else depending on your display. For my Odyssey neo G7, 2.4 looked closest to how SDR mode displayed black levels, 2.2 was still a little too washed out. Your display might be fine with gamma 2.2 however.

As mentioned in the issues page I linked, use WIN+F2 to apply the tonemapping and WIN+F1 to reset all changes.

If you still want to change your peak nits for whatever reason, the Windows HDR calibration app can be used to do that and works fine alongside this script.

Jason-GitH commented 11 months ago

Personally I use this autohotkey script by mspeedo, which does not change the peak nits reported to Windows and uses the value from your monitor. You can disable it on the fly for real HDR content, which should have this tonemapping fix disabled anyway as it can cause crushed blacks. After you've installed and configured the prerequisites, download the pastebin text file and change its extension to ".ahk" instead of ".txt" to be able to run it.

You just need to edit the script file and change "whiteLuminance" to the equivalent nits value as your preferred Windows "SDR content brightness" value, like shown here:

Windows SDR content brightness at 100 (480 nits)

I've set whiteLuminance to 480 in that image because my SDR content brightness was set to 100, which is equivalent to 480 nits SDR brightness. (Refer to this handy table to find out what nit value you should use for whiteLuminance)

SDR content brightness value

I also highlighted the "gamma" setting too since you might want to change that to something else depending on your display. For my Odyssey neo G7, 2.4 looked closest to how SDR mode displayed black levels, 2.2 was still a little too washed out. Your display might be fine with gamma 2.2 however.

As mentioned in the issues page I linked, use WIN+F2 to apply the tonemapping and WIN+F1 to reset all changes.

If you still want to change your peak nits for whatever reason, the Windows HDR calibration app can be used to do that and works fine alongside this script.

Hey, this works amazingly well. I noticed that the minTML gets changed to 0.0100 nits when using the Windows HDR Calibration app in conjunction with this script but it will stay at 0 nits if HDR static metadata values are modified in CRU.

Animesh-Does-Code commented 11 months ago

Hey, this works amazingly well. I noticed that the minTML gets changed to 0.0100 nits when using the Windows HDR Calibration app in conjunction with this script but it will stay at 0 nits if HDR static metadata values are modified in CRU.

I just checked and yeah minTML does get set to 0.0100 nits with any HDR calibration app profile enabled, but it doesn't seem to be related to the script from what I can tell, as closing the script and even restarting my PC didn't make the calibration profile use exactly 0 nits like it should, even with a newly created calibration profile. Maybe it's a bug with the calibration app itself. Setting peak nits using CRU is definitely preferable if you can do it.

Alternatively, you can set peak nits with set_maxtml by ledoge if for some reason CRU doesn't work for you or you can't access the static metadata menu. This is the case for my monitor when using DSC, which is needed for 4K 165Hz on DisplayPort 1.4.

Jason-GitH commented 11 months ago

If you still want to change your peak nits for whatever reason, the Windows HDR calibration app can be used to do that and works fine alongside this script.

Is there any way to create a single script file that could have separate keyboard shortcuts for gamma 2.2 and gamma 2.4?

Animesh-Does-Code commented 11 months ago

Is there any way to create a single script file that could have separate keyboard shortcuts for gamma 2.2 and gamma 2.4?

Yes, if you know your way around creating autohotkey scripts, you definitely can. I'm no expert at that but I just edited the code that applied tonemapping and added two shortcuts just for gamma 2.2 and 2.4:

#F3::    ;Win
^+F3::   ;Ctrl Shift
  gamma := 2.2
  CREATE_LUT_FILE(whiteLuminance,blackLuminance,gamma)
  LoadCalibrationCurve("templut")
Return

#F4::    ;Win 
^+F4::   ;Ctrl Shift 
  gamma := 2.4
  CREATE_LUT_FILE(whiteLuminance,blackLuminance,gamma)
  LoadCalibrationCurve("templut")
Return

Add these lines under the F2 shortcut code:

sublime_text_2023-12-04_22-25-03

Use WIN+F3 for gamma 2.2 and WIN+F4 for gamma 2.4

Jason-GitH commented 11 months ago

Use WIN+F3 for gamma 2.2 and WIN+F4 for gamma 2.4

How would the Global Gamma being left at 2.2 affect the gamma being set to 2.4 in calibration curve section?

Animesh-Does-Code commented 11 months ago

How would the Global Gamma being left at 2.2 affect the gamma being set to 2.4 in calibration curve section?

I don't think the "global" settings are being read at all in the script when you apply a new curve, it might just be to initialize the variable. I set the global luminance and gamma values to crazy numbers but they didn't affect the end result when using the shortcuts at all. Even deleting them didn't change anything, though I'd leave them as they are with the luminance and gamma values you've set.

ABDX80 commented 11 months ago

Personally I use this autohotkey script by mspeedo, which does not change the peak nits reported to Windows and uses the value from your monitor. You can disable it on the fly for real HDR content, which should have this tonemapping fix disabled anyway as it can cause crushed blacks. After you've installed and configured the prerequisites, download the pastebin text file and change its extension to ".ahk" instead of ".txt" to be able to run it.

You just need to edit the script file and change "whiteLuminance" to the equivalent nits value as your preferred Windows "SDR content brightness" value, like shown here:

Windows SDR content brightness at 100 (480 nits)

I've set whiteLuminance to 480 in that image because my SDR content brightness was set to 100, which is equivalent to 480 nits SDR brightness. (Refer to this handy table to find out what nit value you should use for whiteLuminance)

SDR content brightness value

I also highlighted the "gamma" setting too since you might want to change that to something else depending on your display. For my Odyssey neo G7, 2.4 looked closest to how SDR mode displayed black levels, 2.2 was still a little too washed out. Your display might be fine with gamma 2.2 however.

As mentioned in the issues page I linked, use WIN+F2 to apply the tonemapping and WIN+F1 to reset all changes.

If you still want to change your peak nits for whatever reason, the Windows HDR calibration app can be used to do that and works fine alongside this script.

Is Gamma 2.4 better for Neo G9 too? @Animesh-Does-Code

ABDX80 commented 11 months ago

Hey, this works amazingly well. I noticed that the minTML gets changed to 0.0100 nits when using the Windows HDR Calibration app in conjunction with this script but it will stay at 0 nits if HDR static metadata values are modified in CRU.

I just checked and yeah minTML does get set to 0.0100 nits with any HDR calibration app profile enabled, but it doesn't seem to be related to the script from what I can tell, as closing the script and even restarting my PC didn't make the calibration profile use exactly 0 nits like it should, even with a newly created calibration profile. Maybe it's a bug with the calibration app itself. Setting peak nits using CRU is definitely preferable if you can do it.

Alternatively, you can set peak nits with set_maxtml by ledoge if for some reason CRU doesn't work for you or you can't access the static metadata menu. This is the case for my monitor when using DSC, which is needed for 4K 165Hz on DisplayPort 1.4.

How do you use the Set_MaxTML? I don't see any .exe file. Could you please guide me?! @Animesh-Does-Code

Animesh-Does-Code commented 11 months ago

Is Gamma 2.4 better for Neo G9 too? @Animesh-Does-Code

It most probably is, assuming you are using your monitor's default settings for gamma and contrast, and also have contrast enhancer set to "off" if you have that setting in your monitor.

You could still visually verify if 2.4 is indeed the best setting by using this black level test and switching between SDR and HDR modes in Windows. Turn local dimming off in your monitor completely for both SDR and HDR mode when you do this to get the most consistent view of what gamma setting is closest to your monitor in SDR mode.

How do you use the Set_MaxTML? I don't see any .exe file. Could you please guide me?! @Animesh-Does-Code

You need to download the release.zip file which contains the .exe from the releases page and extract it into any folder. Then open terminal/cmd in that folder with the .exe and then type (for example) set_maxtml 1 1000 and press enter, which sets your main monitor's peak nits to 1000. Change '1000' in that command to your preferred nit value.

ABDX80 commented 11 months ago

Is Gamma 2.4 better for Neo G9 too? @Animesh-Does-Code

It most probably is, assuming you are using your monitor's default settings for gamma and contrast, and also have contrast enhancer set to "off" if you have that setting in your monitor.

You could still visually verify if 2.4 is indeed the best setting by using this black level test and switching between SDR and HDR modes in Windows. Turn local dimming off in your monitor completely for both SDR and HDR mode when you do this to get the most consistent view of what gamma setting is closest to your monitor in SDR mode.

How do you use the Set_MaxTML? I don't see any .exe file. Could you please guide me?! @Animesh-Does-Code

You need to download the release.zip file which contains the .exe from the releases page and extract it into any folder. Then open terminal/cmd in that folder with the .exe and then type (for example) set_maxtml 1 1000 and press enter, which sets your main monitor's peak nits to 1000. Change '1000' in that command to your preferred nit value.

Thanks for getting back! Aha I see, I downloaded the wrong files. After downloading and extracting the "release.zip", running "set_maxtml.exe" opens CMD terminal but it closes itself immediately, same is the case even if I run it as Administrator. I'm using the 'Unspecified Profile' OP provided. Any remedies? Thanks again! @Animesh-Does-Code

Animesh-Does-Code commented 11 months ago

Thanks for getting back! Aha I see, I downloaded the wrong files. After downloading and extracting the "release.zip", running "set_maxtml.exe" opens CMD terminal but it closes itself immediately, same is the case even if I run it as Administrator. I'm using the 'Unspecified Profile' OP provided. Any remedies? Thanks again! @Animesh-Does-Code

You need to run terminal in the folder that contains set_maxtml.exe, not the .exe itself. In Windows 11 you can right click in an empty space in that folder and you'll get an option to "Open in Terminal." Type that command from before in that new terminal window.

ABDX80 commented 11 months ago

Thanks for getting back! Aha I see, I downloaded the wrong files. After downloading and extracting the "release.zip", running "set_maxtml.exe" opens CMD terminal but it closes itself immediately, same is the case even if I run it as Administrator. I'm using the 'Unspecified Profile' OP provided. Any remedies? Thanks again! @Animesh-Does-Code

You need to run terminal in the folder that contains set_maxtml.exe, not the .exe itself. In Windows 11 you can right click in an empty space in that folder and you'll get an option to "Open in Terminal." Type that command from before in that new terminal window.

Aha okay. Dang it, no luck :(

This is what the error msg I get:

PS C:\Users\black\Downloads\Set_MaxTML> set_maxtml 1 1040 set_maxtml : The term 'set_maxtml' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

Anything still wrong??

I tried 'set_maxtml' command beforehand "to get a list of the currently active monitors and their current maxTML values" but same error on this command too. @Animesh-Does-Code

Animesh-Does-Code commented 11 months ago

Anything still wrong??

I tried 'set_maxtml' command beforehand "to get a list of the currently active monitors and their current maxTML values" but same error on this command too. @Animesh-Does-Code

I think Windows Terminal is running PowerShell instead of Command Prompt for you by default. In that case first type cmd to switch to command prompt and then run that command again. PowerShell doesn't run commands from your current folder location by default, but cmd does.

ABDX80 commented 11 months ago

Anything still wrong?? I tried 'set_maxtml' command beforehand "to get a list of the currently active monitors and their current maxTML values" but same error on this command too. @Animesh-Does-Code

I think Windows Terminal is running PowerShell instead of Command Prompt for you by default. In that case first type cmd to switch to command prompt and then run that command again. PowerShell doesn't run commands from your current folder location by default, but cmd does.

Worked like a charm! But there's an issue -- as soon I open display settings it reverts back to default value; I assume it's the same if I reboot the PC. Any fix for this? @Animesh-Does-Code

dm-u commented 11 months ago

Alternative fast solution with similar effect: use appropriate control panel to decrease brightness and increase contrast for gaming mode. Make it according to perception. For example, NVIDIA Control panel: set Brightness 40 Contrast 60 (numbers are very approximate).

Animesh-Does-Code commented 11 months ago

Worked like a charm! But there's an issue -- as soon I open display settings it reverts back to default value; I assume it's the same if I reboot the PC. Any fix for this? @Animesh-Does-Code

The readme page for set_maxtml says the peak nits value should persist until a reboot as long as you don't have an advanced color profile assigned to your monitor, which is probably re-applying when you open display settings. You might have an HDR calibration profile assigned which is causing that.

Go to "Color Management" from your start menu, then either untick "Use my settings for this device" or select the calibration profile you've made under "Advanced Color" ICC profiles and click remove to stop Windows from reverting the nits value.

Unfortunately it won't persist after a reboot, which is a limitation of this program and we can't do anything about it for now:

As long as you don't reboot, the set value seems to persist between switching from HDR to SDR and back, as long as you don't have an "Advanced Color Profile" assigned in Windows.

I'm not sure if the developer can do anything about it either, as it might be a Windows limitation.

dylanraga commented 11 months ago

You can try following my new alternative procedure to generate/apply your own LUT. Use the profile generated from Windows HDR Calibration.