# Is there an alternative to canvas.getImageData?

**URL:** https://react-native-webrtc.discourse.group/t/is-there-an-alternative-to-canvas-getimagedata/1009
**Category:** Help
**Created:** [October 28, 2020, 10:17am UTC](https://react-native-webrtc.discourse.group/t/is-there-an-alternative-to-canvas-getimagedata/1009 "2020-10-28T10:17:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Pondia](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@Pondia](https://react-native-webrtc.discourse.group/u/Pondia)
#### Post date: [October 28, 2020, 10:17am UTC](https://react-native-webrtc.discourse.group/t/is-there-an-alternative-to-canvas-getimagedata/1009/1 "2020-10-28T10:17:48Z")

</div>

Hello world,

Is it possible to get a `Uint8ClampedArray` of RGBA pixel values ​​or from `ImageData` interface from `mediaDevices` perperty ?

I’m trying to do something like this :

```
var canvasElement = document.createElement("canvas");            
var canvas = canvasElement.getContext("2d");
canvasElement.height = video.videoHeight;
canvasElement.width = video.videoWidth;
canvas.drawImage(video, 0, 0, canvasElement.width, canvasElement.height);
var imageData = canvas.getImageData(0, 0, canvasElement.width, canvasElement.height);

```

Is there an alternative on react-native-webrtc?

Any ideas is welcome

Thanks !

---

<div class="post-metadata">

### Author: ![Pondia](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@Pondia](https://react-native-webrtc.discourse.group/u/Pondia)
#### Post date: [October 28, 2020, 11:42am UTC](https://react-native-webrtc.discourse.group/t/is-there-an-alternative-to-canvas-getimagedata/1009/2 "2020-10-28T11:42:13Z")

</div>

seems to be related to this : [https://github.com/react-native-webrtc/react-native-webrtc/issues/176](https://github.com/react-native-webrtc/react-native-webrtc/issues/176)
