13thsymphony / HDRImageViewer

UWP app to view high dynamic range (HDR) and wide color gamut (WCG) images.
https://13thsymphony.github.io/
MIT License
76 stars 21 forks source link

Handle OpenEXR chromaticities for color management, Sun Valley style enablement #50

Closed imbushuo closed 1 year ago

imbushuo commented 2 years ago

Certain OpenEXR images may use color spaces such as ACES, therefore it's important to read chromaticities information and provide corresponding input to color management for accurate color reproduction (seems like even Photoshop is not doing so.)

The retrieval routine partially reuses the color information override routine for generating D2D1 Color Context, renamed corresponding variables to represent their corresponding purpose now: m_customOrDerivedColorProfile.

Partially included the fix at https://github.com/13thsymphony/HDRImageViewer/pull/46 to address a build break. Unit tests are not fixed though (looks like they are kind of abandoned for a while.)

Included WinUI 2.7 package and enabled Windows 11 / Sun Valley visual styles.

Screenshots

Before

HDR + WCG Image Viewer 3_21_2022 1_48_30 AM

After

HDR + WCG Image Viewer (Debug) 3_21_2022 1_48_24 AM

13thsymphony commented 1 year ago

imbushuo shared some test images: https://github.com/AcademySoftwareFoundation/openexr-images/tree/master/Chromaticities

13thsymphony commented 1 year ago

Thanks for your patience! I've made two tiny functional changes, falling back to a D65 whitepoint if white.y == 0, and updating Windows SDK prereqs. If you have no issues with my updates then I'll merge this.

13thsymphony commented 1 year ago

I hijacked this PR a bit to do some more project file cleanups. I'll go ahead and merge this and we can pick up any additional changes later if needed. Thanks for the contribution!