Optionaloptions: RequestInitDecodes an image already in memory.
A Buffer is decoded from its own bytes. A Sharp image is converted to raw
RGBA first -- with an alpha channel added if it has none -- so a pipeline
can hand its output straight over without encoding to an intermediate
format.
Decodes an image from a path, a URL, a
data:URL or a buffer.The source decides how it is read: an
http:orhttps:string is fetched, whereoptionsare thefetchrequest options; adata:URL is decoded in place; anything else that is a string is read from disk as a path. The promise rejects if the bytes are not an image this build can decode.🧪
loadImageis not in the HTML Canvas standard -- a browser assigns toimg.srcand waits for itsloadevent -- but Image is, and the result can be drawn withdrawImageexactly as one would be there.