Skip to content

Make pixel blenders public #426

@vpenades

Description

@vpenades

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

I miss some method to write a single pixel with a blend state, for example:

Let's say I have an image, and I want to do something like this:

image.SetPixel(RGBA.Red,PixelBlenderState.Multiply, 0.7f);

I know I can use Mutate Fill with a rectangle selecting a single pixel, but I think it's a bit overkill.

Alternatively, it could be good enough to extend the PixelBlenderMode operations to pixel format colors:

Argb32 color1 = Argb32.Red;
Argb32 color2 = Argb32.Blue;
Argb32 color3 = Argb32.Blend(color1,color2,PixelBlenderMode.Multiply);

or

pixelBlender = Argb32.GetBlender(PixelBlenderMode.Multiply);
Argb32 color3 = pixelBlender(color1,color2);

Steps to Reproduce

not applicable

System Configuration

not applicable

  • ImageSharp version: 1.0.0-beta0002
  • Other ImageSharp packages and versions:
  • Environment (Operating system, version and so on):
  • .NET Framework version:
  • 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