Open RReverser opened 1 year ago
👍 Fully agree, i think the api should be more aligned with OffscrenCanvas and how it works in web workers.
import fs from 'node:fs'
const blob = await fs.openAsBlob(path)
const canvas = new OffscreenCanvas(width, height)
const bitmap = await createImageBitmap(blob)
const result = await canvas.convertToBlob(options)
I also think that the Image
class should eventually be removed and deprecated. And everybody should only use the createImageBitmap
that way you could also remove simple-get
which i do not think belongs in here.
It would be great to support the standard
createImageBitmap
which async utility a lot like customloadImage
provided by this library, but with more control over rasterization.