Skip to content

Instantly share code, notes, and snippets.

@JimBobSquarePants
Created May 16, 2024 05:22
Show Gist options
  • Save JimBobSquarePants/4dfff5f80af32da980016f38076c88f1 to your computer and use it in GitHub Desktop.
Save JimBobSquarePants/4dfff5f80af32da980016f38076c88f1 to your computer and use it in GitHub Desktop.
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors.Quantization;
void Main()
{
using Image image = Image.Load(@"C:\Users\james\Downloads\fish.png");
image.Mutate(x => x.Quantize(new WuQuantizer(new() { MaxColors = 7 })));
image.Save(@"C:\Users\james\Downloads\fish-7-colors.png");
}
@JimBobSquarePants
Copy link
Author

fish
fish-7-colors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment