lut
lut

Reputation: 150

Is there any way to access react native image's bitmap directly?

I am working on a project which needs a lot of image processing on the client side. I need to blur some parts of the image, add RGB noise and so on.

I've already tried WebView Canvas based solution (https://github.com/iddan/react-native-canvas) but this package looks abandoned, so I've changed a plan.

I would like to work with Bitmap directly. Any ideas about how I can get the bitmap of an Image in react native?

Upvotes: 4

Views: 6109

Answers (1)

jevakallio
jevakallio

Reputation: 35920

You won't be able to access the raw bitmap data of the React Native <Image> (aka. RCTImage) component.

The best way to achieve what you're looking to do is likely going to be to use the Native UI Components API for iOS and Android to implement a custom native image view that applies the effects you are looking for.

Alternatively, you could look at packages like gl-react-native to impement your effects as GL shaders.

Upvotes: 4

Related Questions