Skip to content

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

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

Activity

  1. added a commit that references this issue on Jul 13, 2022
  2. brianpopow commented on Jul 13, 2022

    @brianpopow
    Collaborator

    Thanks @mrznake for this bug report. I am working on a fix for this.

  3. brianpopow commented on Aug 3, 2022

    @brianpopow
    Collaborator

    @mrznake this should be fixed with #2173. If you have time could you confirm that with our nightly MyGet build?

  4. 4dp commented on Aug 3, 2022

    @4dp
    Author

    @brianpopow it looks like it's okay now. Output files looks like this:
    image

  5. brianpopow commented on Aug 3, 2022

    @brianpopow
    Collaborator

    Ok, thanks for confirming, closing this then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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