-
-
Notifications
You must be signed in to change notification settings - Fork 887
Closed
Labels
Milestone
Description
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
andRELEASE
mode - [+] I have searched open and closed issues to ensure it has not already been reported
Description
Hello,
i'm trying to resize the following test image (1500x1500) to 250x350px and keep white background:
Steps to Reproduce
- Upload the image above to the local folder
- Encode it with the following code
var encoder = new WebpEncoder
{
Quality = 100,
Method = WebpEncodingMethod.BestQuality,
};
var resizeOptions = new ResizeOptions
{
Mode = ResizeMode.Pad,
Size = new Size(250, 350)
};
using var image = Image.Load(fileName, out var imageFormat);
image.Mutate(x => x.Resize(resizeOptions).BackgroundColor(Color.White));
image.SaveAsWebp(newFileName, encoder);
Expected result (green box in the middle, white background):
Actual result (green box in the middle, black background):
System Configuration
- ImageSharp version: 2.0.0
- Other ImageSharp packages and versions: n/a
- Environment (Operating system, version and so on): Microsoft Windows [Version 10.0.19043.1466]
- .NET Framework version: NET 6 Console app & ASP.NET CORE
- Additional information: n/a