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

Support saving textures to non-built in ContainerFormats #800

Open
elyoh opened this issue May 31, 2024 · 0 comments
Open

Support saving textures to non-built in ContainerFormats #800

elyoh opened this issue May 31, 2024 · 0 comments
Labels
proposal 💡 A proposal for a new feature untriaged 🧰 A new issue that needs initial triage

Comments

@elyoh
Copy link
Contributor

elyoh commented May 31, 2024

Rationale

WIC is extensible and allows users to register other ContainerFormats for use. Today, if a user has installed the HEIF Image Extensions from the Microsoft Store, they can load an image in that format by passing a FileStream to the texture.

During save, the output format is either determined from the file extension (see #799) or the provided ImageFormat. Only built in ContainerFormats can be used.

Proposed API

The proposed API would allow users to specify the output format using a ContainerFormat provided in the form of a Guid instead.

Drawbacks

Unknown.

Alternatives

Unknown.

Other thoughts

In .NET WPF, a custom WIC encoder can be constructed from the ContainerFormat Guid. For example using BitmapEncoder.Create(new("E1E62521-6787-405B-A339-500715B5763F")) hooks up the HEIF Image Extensions from the Microsoft Store and allows users to save images in this format. Note this only works on later .NET and not in the .NET Framework due to a bug (dotnet/wpf#6344).

@elyoh elyoh added proposal 💡 A proposal for a new feature untriaged 🧰 A new issue that needs initial triage labels May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal 💡 A proposal for a new feature untriaged 🧰 A new issue that needs initial triage
Projects
None yet
Development

No branches or pull requests

1 participant