Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

createImageBitmap support #123

Open
RReverser opened this issue Nov 1, 2022 · 2 comments
Open

createImageBitmap support #123

RReverser opened this issue Nov 1, 2022 · 2 comments

Comments

@RReverser
Copy link

It would be great to support the standard createImageBitmap which async utility a lot like custom loadImage provided by this library, but with more control over rasterization.

@jimmywarting
Copy link

👍 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)

@jimmywarting
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants