# Read the pixels of input file

**URL:** <https://discourse.processing.org/t/read-the-pixels-of-input-file/24797>\
**Category:** Coding Questions\
**Created:** [October 21, 2020, 3:21pm UTC](https://discourse.processing.org/t/read-the-pixels-of-input-file/24797 "2020-10-21T15:21:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pixelMaker](https://avatars.discourse-cdn.com/v4/letter/p/87869e/32.png) [@pixelMaker](https://discourse.processing.org/u/pixelMaker)\
**Post date:** [October 21, 2020, 3:21pm UTC](https://discourse.processing.org/t/read-the-pixels-of-input-file/24797/1 "2020-10-21T15:21:06Z")

</div>

Hi,

I have been working with processing on java for a while, but new to JS.  
I am trying to let the user upload an image, and then I want to be able to use get() or pixels[] to read specific pixels within the image the user uploaded.  
Any idea how to do that?

This is my setup

```auto
input = createFileInput(handleFile);
  input.position(50, 100);

```

this is my handleFile

```auto

async function handleFile(file) 
{
  if (file.type === 'image') 
  {

    img = await createImg(file.data);
}
}

```

and I cant access the pixels of img. any idea what to do?

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [October 21, 2020, 3:26pm UTC](https://discourse.processing.org/t/read-the-pixels-of-input-file/24797/2 "2020-10-21T15:26:20Z")

</div>

> **[Image Drop](https://Bl.ocks.org/GoSubRoutine/22e47de702d3c8d86585f80f652d8179)**
>
> GoSubRoutine’s Block 22e47de702d3c8d86585f80f652d8179
