Skip to content

JPEG decoder will generate wrong pixel colors sometime #155

@sgjsakura

Description

@sgjsakura

Description

The JPEG Decoder will generate pixel colors with slight changes compared with the original color.

Steps to Reproduce

Using the following simple code to reproduce the problem, here the test image "test1.jpg" can be downloaded via http://galnote.com/StaticFiles/attachments/1703/djqanebq.jpg

var inputFile = @"image\test1.jpg";

using (var image = new Image(inputFile))
using (var accessor = image.Lock())
{
	var c = accessor[1000, 555];
}

The above code will get the color of the pixel at (1000, 555) location, and the value of c will be RGB(249,243,222). However the actual color in this point should be RGB(250, 243, 224). This problem will further image processings such as saving it using SaveAsBmp method. However Photoshop and Micorosft Paint app can correctly decode the pixels.

System Configuration

  • ImageSharp version: 1.0.0-alpha4-00048
  • Other ImageSharp packages and versions: None
  • Environment (Operating system, version and so on): Windows 10 Build 1607 with Jan 2017 Update
  • .NET Framework version: .NET Core App 1.1 (the version of Micorosft.NETCore.App is 1.1.1)
  • Additional information: None

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