API local file as image

Hello,

Is it possible to use a local file as image? I haven’t been able to get this to work as I am not that familiar with JS and API’s in general.