Skip to content

Webp with lossy conversion weighs a lot more than lossless. #2171

@4dp

Description

@4dp

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

2.1.3

Other ImageSharp packages and versions

Environment (Operating system, version and so on)

x86-64 Win11

.NET Framework version

.NET 6.0

Description

Webp with lossy conversion weighs more than lossless regardless of quality used.

image

Steps to Reproduce

using SixLabors.ImageSharp;

var image = SixLabors.ImageSharp.Image.Load("startFile.png");

image.Save("outLossless.webp", new SixLabors.ImageSharp.Formats.Webp.WebpEncoder
{
    FileFormat = SixLabors.ImageSharp.Formats.Webp.WebpFileFormatType.Lossless
});

image.Save("outLosssy90.webp", new SixLabors.ImageSharp.Formats.Webp.WebpEncoder
{
    FileFormat = SixLabors.ImageSharp.Formats.Webp.WebpFileFormatType.Lossy,
    Quality = 90,
});

image.Save("outLosssy80.webp", new SixLabors.ImageSharp.Formats.Webp.WebpEncoder
{
    FileFormat = SixLabors.ImageSharp.Formats.Webp.WebpFileFormatType.Lossy,
    Quality = 80,
});

image.Save("outLosssy50.webp", new SixLabors.ImageSharp.Formats.Webp.WebpEncoder
{
    FileFormat = SixLabors.ImageSharp.Formats.Webp.WebpFileFormatType.Lossy,
    Quality = 50,
});

image.Save("outLosssy10+Alpha.webp", new SixLabors.ImageSharp.Formats.Webp.WebpEncoder
{
    FileFormat = SixLabors.ImageSharp.Formats.Webp.WebpFileFormatType.Lossy,
    UseAlphaCompression = true,
    Quality = 10,
});

image.Dispose();

Images

Start image:
startFIle

Result images:
test.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