AutoDarkMode / Windows-Auto-Night-Mode

Automatically switches between the dark and light theme of Windows 10 and Windows 11
GNU General Public License v3.0
7.5k stars 266 forks source link

JPEG XR Wallpaper Support #872

Open willamettefour opened 2 months ago

willamettefour commented 2 months ago

Describe the enhancement or feature you'd like Windows 11 24H2 (which, yes, I know is still technically an insider build) allows you to have HDR wallpapers using a JPEG XR image. However, AutoDarkMode currently only allows PNGs, JPEGs, and bitmaps to be selected.

Describe alternatives you've considered As I understand it, the only way to get an HDR background is by using a JXR image. I've tried replacing the .jxr file extension with .png to force AutoDarkMode to accept the file, but that results in the wallpaper having messed-up colors.

Spiritreader commented 1 month ago

Could you verify that both

SystemParametersInfoA: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa

SPI_SETDESKWALLPAPER 0x0014

and IDesktopWallpaper https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-idesktopwallpaper

support JPEG XR? These are the two interfaces we use.

I don't have a HDR display, so getting this implemented would need third party testing and/or development assistance.

If so, i can just enable support in the UI.

ThioJoe commented 1 month ago

Actually they do work (just tested it), you just need to have HDR mode enabled. The preview won't look right but when it gets applied as the wallpaper it will look right.

image

Also by the way, you can work around the file selection types by putting an asterisk in the file name box and hitting enter, which will allow you to select any file type. This works for any windows program.

image

I will point out the native background image picker in Windows does allow for a lot more options than it lets you pick in ADM.

Might be worth adding the same options. For the more rare ones that might not be worth adding a bunch of code just to display a preview, you could just add a placeholder message saying "Can only preview [whatever types]."

image

(Ignore the blown out colors for the wallpaper in that screenshot, it looks correct in real life)

Spiritreader commented 1 month ago

Might be worth adding the same options. For the more rare ones that might not be worth adding a bunch of code just to display a preview, you could just add a placeholder message saying "Can only preview [whatever types]."

@ThioJoe I've added all supported options to the UI selector. In theory any image file that are listed here should also be previewable by the UI framework, they might just look off. Does the preview look okay for you?

@willamettefour jpeg xr should work in the latest beta build (10.4.2.24)