Color reduction

Hello,
How to make a color reduction to 16 colors of a Skiasharp bitmap ?
Thank you,
Christophe

Posts

  • mattleibowmattleibow ZAXamarin Team Xamurai

    It depends on what you mean.

    If you mean a nice, quick way to reduce the number of colors. I don't think there is one. SkiaSharp is more a drawing framework than an image editing one.

    If you mean a way to reduce colors per pixel, you can do this by loading a SKBitmap and replacing the color for each pixel: SKBitmap.Pixels or SKBitmap.Bytes.

    Even if you can do this, I don't think SkiaSharp can save these formats. It typically reverts to a RGBA-32 color type (in PNG/JPG). I am not too familiar with existing frameworks that can manage colors/image formats. As this is probably a general .NET question, you may be better served in a less-specific topic.

Sign In or Register to comment.