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

WebP: Lossy and transparency #1823

Closed
4 tasks done
PhyxionNL opened this issue Nov 11, 2021 · 1 comment
Closed
4 tasks done

WebP: Lossy and transparency #1823

PhyxionNL opened this issue Nov 11, 2021 · 1 comment

Comments

@PhyxionNL
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

I'm unable to get lossy and transparency to work together. In lossless mode, it works OK, but in lossy the alpha channel is always rendered as black. I've experimented with the TransparentColorMode = WebpTransparentColorMode.Preserve option but that didn't help. According to Google ( https://developers.google.com/speed/webp/gallery2 ) it should be possible to combine alpha with lossy mode.

Steps to Reproduce

  using var img = SixLabors.ImageSharp.Image.Load("in.png"); // Something with transparency.

  using var fs = new FileStream("out.webp", FileMode.OpenOrCreate);

  img.Save(fs, new WebpEncoder { FileFormat = WebpFileFormatType.Lossy});

System Configuration

  • ImageSharp version: 2.0 alpha 99
  • Other ImageSharp packages and versions: -
  • Environment (Operating system, version and so on): Windows 10.
  • .NET Framework version: .NET 5.0 / 6.0.
@PhyxionNL
Copy link
Author

E: It's in #1802 already, somehow it didn't show up in search. Closing...

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