Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

AdaptiveThresholdProcessor throws IndexOutOfRangeException #2217

Copy link
Copy link

Description

@mjeanrichard
Issue body actions

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

none

Environment (Operating system, version and so on)

Windows 10

.NET Framework version

.net 6

Description

The attached image produces a IndexOutOfRangeException when mutated with the AdaptiveThresholdProcessor.
It might be because the Image is black and white already?

Steps to Reproduce

  1. Create a new console application
  2. Add the attached image as embedded resource
  3. Put the following code in Program.cs
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors.Binarization;

Stream? stream = typeof(Program).Assembly.GetManifestResourceStream("ConsoleApp1.TestImage.png");
Image<Rgba32> image = await Image.LoadAsync<Rgba32>(stream);
AdaptiveThresholdProcessor p = new();

image.Mutate(i => i.ApplyProcessor(p));
  1. Run

Images

TestImage

Reactions are currently unavailable

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

Morty Proxy This is a proxified and sanitized view of the page, visit original site.