How to create img obejct in index.js file directly

I want to create an img object which I want to use in my code later.
I tried like
cost img = ‘imagecsource_url’

But I get error
Error: pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was String

Any idea how to create any of above types of image object in index.js file

Afraid the forum here is not for generic development questions. If you need help here you best check out StackOverflow or Reddit.