-
Hi, friend, I am trying to make Image as B/ W dualization. And Color Matrix does not meet my requirement. const BLACK_AND_WHITE = [
// r-rbgam
0, 1, 0, 0, 0,
// g-rbgam
0, 1, 0, 0, 0,
// b-rbgam
0, 1, 0, 0, 0,
// a-rbgam
0, 0, 0, 1, 0,
]
<Image {...{ ...props }}>
<ColorMatrix matrix={BLACK_AND_WHITE} />
</Image> it looks like gray mode, but not Black and White mode(I mean only two color mode, 0 or 255). is there any suggestion, thanks a lot. |
Beta Was this translation helpful? Give feedback.
Answered by
tylerrrkd
Jul 26, 2023
Replies: 1 comment 5 replies
-
It might be possible via a matrix but just in case you can use a custom shader for this as an image filter: https://shopify.github.io/react-native-skia/docs/image-filters/runtime-shader |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@bennyli519 Hi friend, you could use my code.