-
I'm using non-separable blend modes like this SKColorFilter.CreateBlendMode(SKColors.Red, SKBlendMode.Color) to replace "colored" pixel for an image (e.g. eye color). Unfortunately in this sample this will also transform transparent pixels to red. |
Beta Was this translation helpful? Give feedback.
Answered by
Dresel
Dec 3, 2022
Replies: 1 comment
-
I was looking for a public static SKImage Colorize(SKImage image, SKColor color)
{
var filter = SKImageFilter.CreateBlendMode(SKBlendMode.DstIn,
SKImageFilter.CreateColorFilter(SKColorFilter.CreateBlendMode(color, SKBlendMode.Color))
);
return image.ApplyImageFilter(filter, image.Info.Rect, image.Info.Rect, out _, out SKPointI _);
} See StackOverflow. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Dresel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was looking for a
SKImage.ApplyImageFilter
solution, this is possible by wrapping the SKImageFilter:See StackOverflow.