Skip to content

transparency issues with some .webp images #2528

@Lovrenc

Description

@Lovrenc

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

ImageSharp version

3.0.2

Other ImageSharp packages and versions

/

Environment (Operating system, version and so on)

ubuntu 20.04, win 11, ryzen

.NET Framework version

7.0

Description

Most images work fine, but some will replace part of the transparent background with white background (but not all of it, a small rectangle around the image stays transparent).

Here are the results as viewed in an image viewer.
Original:
image

Result:
image

Steps to Reproduce


var img = Image.Load("d:\\bugged_image.webp");
var encoder = new WebpEncoder()
{
    TransparentColorMode = WebpTransparentColorMode.Preserve
};
img.Mutate(t => t.Resize(img.Width/2, img.Height/2));
img.Save("d:\\bugged_image_result.webp");

Images

bugged_image.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions