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

[Feature Request] WebP image format support #19

Closed
tompazourek opened this issue Jul 2, 2018 · 2 comments
Closed

[Feature Request] WebP image format support #19

tompazourek opened this issue Jul 2, 2018 · 2 comments

Comments

@tompazourek
Copy link

tompazourek commented Jul 2, 2018

I'd love to see some support for WebP image format. It's often used to serve smaller image sizes for browsers that support it. I have no idea how difficult it would be to add something like this. Any thoughts on this?

Also, related to this are image formats like JPEG 2000 (JP2) or JPEG XR (JXR). Any thoughts on supporting those?

Some links on the support of those formats in web browsers:

@saucecontrol
Copy link
Owner

For now, all of MagicScaler's codec support comes from the Windows Imaging Component, so if there's a WIC codec, it can be done.

JPEG XR (WMP, HD Photo, whatever...) is built in to WIC, so those can be decoded today and could be encoded in-pipeline if I enabled it.

Google did a read-only WebP codec for WIC some years back and used to have an install package for it on their site, but it seems to have disappeared. It has no metadata support and no encoder, so it would be quite a bit of work to finish it off.

There is also a third-party commercial WIC codec pack that includes JPEG2000 and WebP among others (PSD, etc). These should integrate fine with MagicScaler as well, but I have no experience with them and can't speak to their reliability in a server environment. They may be the easiest path to adding additional codec support, but that's not something I would do myself.

In the long term, I'd like to move toward adding managed codec implementations to break the dependency on WIC. WebP would be further down the list than more popular codecs, though.

In the short term, if you want to deliver WebP, you can do it as a post-processing step. I do this in some of my own workflows by saving to either high-quality JPEG or a fast-encoding lossless format (e.g. uncompressed TIFF) and then running through cwebp. I do likewise for optimized JPEGs with mozjpeg in some cases.

@saucecontrol
Copy link
Owner

The WIC JXR codec was enabled in 0.13, and I've just published a WebP plugin package: https://www.nuget.org/packages/PhotoSauce.NativeCodecs.Libwebp

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

2 participants