Skip to content

Vectorized 4:2:0 subsampling leads to artifacts during Jpeg encoding.  #1549

@JimBobSquarePants

Description

@JimBobSquarePants

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

Issue originally identified by @jrdiver in #1547 Thanks for that!

The new vectorized subsampling algorithm introduced in #1517 by @tkp1n is creating artifacts in our jpeg output. Unfortunately our regression tests did not capture the issue.

v1.0.3-alpha.0.28

fb

v1.0.3-alpha.0.29

fb - Copy

Steps to Reproduce

Simply resaving the input image is enough ensuring the quality is low enough to trigger 4:2:0 subsampling.

using (var image = Image.Load(Path.Combine(inPath, "fb.jpg")))
{
    image.Save(Path.Combine(outPath, "fb.jpg"), new JpegEncoder { Quality = 75 });
}

System Configuration

  • ImageSharp version: v1.0.3-alpha.0.29
  • Other ImageSharp packages and versions: NA
  • Environment (Operating system, version and so on): All
  • .NET Framework version: NET Core 3.1+
  • Additional information:

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