# Convert Image To Pixel Array

**URL:** <https://forums.openmv.io/t/convert-image-to-pixel-array/1310>\
**Category:** OpenMV Boards\
**Created:** [June 23, 2019, 8:10pm UTC](https://forums.openmv.io/t/convert-image-to-pixel-array/1310 "2019-06-23T20:10:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![varun847](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@varun847](https://forums.openmv.io/u/varun847)\
**Post date:** [June 23, 2019, 8:10pm UTC](https://forums.openmv.io/t/convert-image-to-pixel-array/1310/1 "2019-06-23T20:10:00Z")

</div>

Hi Team,  
I am working on a project which involves OpemMv M7 and NodeMCU. I Would like to capture image using OpenMv and Store It to Nodemcu SpiFFs memory using UART, So far I am Able To communicate with openmv and nodemcu using UART also when I try to send image to nodemcu using RXD And TXD Pins I am able to send some strange alphanumeric codes from openmv to nodemcu. Now what I want to do is to convert the image to array list and then send the values to nodemcu for storage so that I can upload it to web and then convert the array to image again but I am not able to convert the image to array using any function as I am not sure if there exist any function which can convert image to string array in micropython openmv library. Please Help me if someone can suggest how to do it.

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [June 23, 2019, 10:21pm UTC](https://forums.openmv.io/t/convert-image-to-pixel-array/1310/2 "2019-06-23T22:21:43Z")

</div>

You have to get a pixel at a time using the get pixel method and send that as ASCII. It’s going to be extremely slow. The hex data you sent before is the raw binary image.

Um, images are treated as linear int arrays BTW. You can just index them with in python to get values. However, I recommend using get\_pixel() for the image if it’s non compressed. If it’s compressed use and the size of the byte array is image.size().

---

<div class="post-metadata">

**Author:** ![varun847](https://avatars.discourse-cdn.com/v4/letter/v/67e7ee/32.png) [@varun847](https://forums.openmv.io/u/varun847)\
**Post date:** [July 10, 2019, 8:40pm UTC](https://forums.openmv.io/t/convert-image-to-pixel-array/1310/3 "2019-07-10T20:40:40Z")

</div>

Hey kwagyeman,  
I Was Actually able to convert the image to hexadecimal code and send it to nodemcu. The Problem is solved that’s for that quick reply. Appreciated. 🕶

---

<div class="post-metadata">

**Author:** ![kwagyeman](https://yyz1.discourse-cdn.com/flex029/user_avatar/forums.openmv.io/kwagyeman/32/4_2.png) [@kwagyeman](https://forums.openmv.io/u/kwagyeman)\
**Post date:** [July 10, 2019, 9:36pm UTC](https://forums.openmv.io/t/convert-image-to-pixel-array/1310/4 "2019-07-10T21:36:16Z")

</div>

Please post the code snippet for others. Thank!

---

<div class="post-metadata">

**Author:** ![AT2OK](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@AT2OK](https://forums.openmv.io/u/AT2OK)\
**Post date:** [June 9, 2021, 4:15am UTC](https://forums.openmv.io/t/convert-image-to-pixel-array/1310/5 "2021-06-09T04:15:46Z")

</div>

How to convert the image to hexadecimal code Please teach me
