Read the pixels of input file


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

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

this is my handleFile

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

    img = await createImg(;

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