# Video Raw Data Frame Colors Issue

**URL:** <https://devforum.zoom.us/t/video-raw-data-frame-colors-issue/68571>\
**Category:** Android\
**Created:** [May 5, 2022, 9:18pm UTC](https://devforum.zoom.us/t/video-raw-data-frame-colors-issue/68571 "2022-05-05T21:18:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wbaroudi](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/wbaroudi/32/30319_2.png) [@wbaroudi](https://devforum.zoom.us/u/wbaroudi)\
**Post date:** [May 5, 2022, 9:18pm UTC](https://devforum.zoom.us/t/video-raw-data-frame-colors-issue/68571/1 "2022-05-05T21:18:32Z")

</div>

**Description**  
Hello,  
As a brief context, I am trying to get video frames from Zoom Video SDK and feed them into Mediapipe Hands model as bitmaps.  
However, I noticed that the conversion from the yuv buffers to bitmaps is resulting in grayscale bitmap images with green and pink spots [please find a screenshot below]

the method I’m using for conversion is the following:

```auto
fun ZoomVideoSDKVideoRawData.toBitmap(): Bitmap? {
    val width = streamWidth
    val height = streamHeight
    val yuvBytes = ByteArray(width * (height + height / 2))
    val yPlane = getyBuffer()
    val uPlane = getuBuffer()
    val vPlane = getvBuffer()
    // copy Y
    yPlane.get(yuvBytes, 0, width * height)
    // copy U
    var offset = width * height
    uPlane.get(yuvBytes, offset, width * height / 4)
    // copy V
    offset += width * height / 4
    vPlane.get(yuvBytes, offset, width * height / 4)
    // make YUV image
    val yuvImage = YuvImage(yuvBytes, ImageFormat.NV21, width, height, null)
    // convert image to bitmap
    val out = ByteArrayOutputStream()
    yuvImage.compressToJpeg(Rect(0, 0, width, height), 50, out)
    val imageBytes = out.toByteArray()
    val image = BitmapFactory.decodeByteArray(imageBytes, 0, imageBytes.size)
    // return result
    return image
}

```

any idea why the colors of the resulting bitmap are corrupted?

**Which Android Video SDK version?**  
Zoom Video SDK 1.2.3 Android

**Screenshots**

 ![zoom-screenshot](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/9/e/9e2c6ebc994fc190ff84e44066a62d3cc687cd7a.jpeg)

_top left is the resulting bitmap_

**Thank you in advance!**

---

<div class="post-metadata">

**Author:** ![poufyy](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@poufyy](https://devforum.zoom.us/u/poufyy)\
**Post date:** [May 16, 2022, 3:16pm UTC](https://devforum.zoom.us/t/video-raw-data-frame-colors-issue/68571/2 "2022-05-16T15:16:28Z")

</div>

I am also interested in this issue. Any updates?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [June 16, 2022, 1:16am UTC](https://devforum.zoom.us/t/video-raw-data-frame-colors-issue/68571/3 "2022-06-16T01:16:44Z")

</div>

Closed on June 16, 2022, 1:16am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
