Skip to content
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

[External] Decoding HDR AVIF image consumes huge amounts of RAM #4968

Open
benstevens48 opened this issue Dec 13, 2024 · 0 comments
Open

[External] Decoding HDR AVIF image consumes huge amounts of RAM #4968

benstevens48 opened this issue Dec 13, 2024 · 0 comments

Comments

@benstevens48
Copy link

Describe the bug

Windows 11 24H2 added support in WIC for decoding HDR AVIF images, which decode to a 64bpp floating point pixel format. However, the decoding process seems to consume a huge amount of RAM. I tested a 20 mega-pixel HDR AVIF exported from Lightroom (which uses the PQ HDR curve I think) and decoding it (in a C++ component) consumes about 2.7GB of RAM (peak in the Visual Studio debugger). The decoded image itself should only consume about 160MB of RAM, and I would expect 2 times or maybe 3 times this at most to be used during decoding. Also, maybe this is inevitable, but it's quite slow. It's much quicker to take a 64bpp PNG with PQ transfer curve, decode that to WIC without color management then use Diret2D to apply the PQ transfer curve.

Steps to reproduce the bug

See description.

Expected behavior

At most ~500MB of RAM used for decoding a 20MP HDR AVIF image, not 2.7GB.

Screenshots

No response

NuGet package version

None

Packaging type

No response

Windows version

No response

IDE

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant