Skip to content

Animesh-Does-Code/win11hdr-srgb-to-gamma2.2-ahk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 

Repository files navigation

Windows 11 SDR-in-HDR curve transformation from piecewise sRGB to Gamma using AutoHotkey

This is a fork of win11hdr-srgb-to-gamma2.2-icm by dylanraga.

dylanraga's original repo contains a great explanation on what is causing a "washed out" look or raised black levels when viewing SDR or AutoHDR content in Windows' HDR mode, and has some alternative workarounds for the issue.

This fork uses an AutoHotkey script + ArgyllCMS dispwin workaround heavily based on mspeedo's .ahk script, which was written using dylanraga's formulas.

Using AutoHotkey allows fast toggling of the gamma transformation, which is useful because the gamma correction can be detrimental to real HDR content, which do not suffer from the same issue this workaround tackles. This method also optionally allows reloading Windows' color calibration with the hotkeys. See Windows color calibration reload function below for more info.

Installation and Usage:

  1. Download HDRGammaFix.zip from the releases page and extract it to an easily accessible location where it can reside permanently.
  2. Run SETUP.bat as administrator.
    • SETUP.bat can also be run without admin permissions, but without the ability to create startup tasks.
  3. Follow the prompts that appear and enter your preferred values.
  4. The script will start running and can be controlled with hotkeys.
    • Use Win+F1 to disable gamma changes and Win+F2 to apply them again.
  5. You can also run the script manually from HDRGammaFix.exe, but only after the initial setup.

Tip:

  • SETUP.bat needs to be run again if SDR content brightness value or gamma need to be changed.
    • Running as administrator is not required when only changing these two settings.

Default Hotkeys

The default hotkeys are as follows:

1. Apply gamma transformation:

  • Win+F2

    or

  • Win+Shift+2

2. Disable gamma transformation (When viewing HDR content):

  • Win+F1

    or

  • Win+Shift+1

3. Restart script: (Used for reloading SDR nits and gamma value changes after setup)

  • Win+Shift+3

Uninstallation

  • Run Uninstall.bat in the "uninstall" folder as administrator, and it should remove the task from task scheduler, if it exists.

  • The script (if running) can be closed from the system tray in your taskbar by right-clicking the green "H" icon.


SDR content brightness slider guide

Find your SDR content brightness slider:

After you've set the slider to where you want it, enter the number that pops up when hovering over the slider's button in the setup.

Windows Color Calibration reload function

If you've used Windows' HDR Calibration app (Windows 11 only) and applied a profile with it, there can be certain situations where it fails to apply.

This can happen after your display goes to sleep mode and wakes up again, or after your PC enters sleep mode and resumes. Reloading Windows' color calibration when applying the gamma transformation will fix this issue without having to open Display settings or Color management.


Notes/Troubleshooting

  • The gamma ramp correction will persist when toggling HDR (including via the keyboard shortcut), making SDR appear darker. When disabling HDR, make sure to revert the gamma correction using the hotkey. Likewise, when re-enabling HDR, you have to re-apply the gamma correction again.
  • If you have an NVIDIA GPU, make sure the NVCP desktop color settings is set to "Accurate" or "Enhanced" mode; the correction will not apply in "Reference" mode.
  • Pixel values above diffuse SDR white are untouched; a soft shoulder was added toward unity to blend the curve mapping with HDR values (Not done by me, all credit goes to dylanraga)

This workaround uses ArgyllCMS' dispwin utility to apply the gamma correction and AutoHotkey to run the script.

About

Transform Windows 11 SDR-in-HDR curve from piecewise sRGB to Gamma using AutoHotkey

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PowerShell 69.3%
  • AutoHotkey 29.4%
  • Batchfile 1.3%