3
myImage.Mutate(i => i.Saturate(2).Resize(new ResizeOptions { Mode = ResizeMode.Crop, Position = AnchorPositionMode.Center, Size = new Size(width, height) }));

I am trying to convert a Photoshop job to be done by ImageSharp in my .NET Core application - most of it goes well, see example above, but I miss 2 things;

How do I adjust Levels (like Image -> Adjustment -> Levels in Photoshop)?

How do I change number of colors used, want to go to e.g. 20 colors (like Image -> Mode -> Index Color in Photoshop)?

I need it to be done between Saturate and Resize if possible at all.

keysersoze
  • 777
  • 3
  • 12
  • 27

1 Answers1

0

For the image -> Adjustment -> Levels you can check this project for example: Image Magic - Image Levels using Custom Controls

David Rechtman
  • 193
  • 1
  • 7
  • I would prefer not to mix too much with ImageSharp - but even though it is not perfect I got pretty close using Contrast, Quantize and ending with Pixelate. – keysersoze Jan 05 '20 at 17:57