[FEATURE] Support new color mapping api
Is your feature request related to a problem?
Skia dropped colormap support for some reason
Describe the solution you would like
Please supply alternative for mapping true color images to a linear color array.
It would be a way to map a true color image to a 32 bit index in a color array. Then it could be shifted and drawn remapped to the palette.
To make it clear this is 3 parts.
- A api to quantization rgba SKBitmaps to a 32 bit indexed SKBitmaps
- A api to shift color quantization palettes
- A api to draw it back to a palette mapped rgba SKBitmap
Describe alternatives you have considered
I tried using avalonia ui WriteableBitmaps but they are too slow.
Additional context
By 32 bit indexed image I mean it would still technically be a rgba image but the integer representation of the color would be used as the index to the color palette.
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
I wonder if this is better with a custom runtime effect / shader? Then you can just draw an image and the effect will be applied.
I am not super useful with writing shaders, but here are some things that may help:
- intro docs: https://skia.org/docs/user/sksl/
- playground: https://shaders.skia.org/
Here is a ShaderToy something that may help: https://www.shadertoy.com/view/XdX3D4
You might be able to do everything you want in a single shader
@taublast I know you are doing cool things with shaders, is this something that you have done before?
Not at all, but the above could be done with a shader indeed, that's maybe why Skia removed their API code.
Logically, upon SkiaSharp v3 release it would be totally up to us developers to provide an implementation for absolutely any image processing, as we would finally have that total powerful possibility in .NET. :)