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

Allow an HTMLCanvasElement as source for the image #75

Open
StephanBijzitter opened this issue Jun 28, 2018 · 7 comments
Open

Allow an HTMLCanvasElement as source for the image #75

StephanBijzitter opened this issue Jun 28, 2018 · 7 comments
Labels

Comments

@StephanBijzitter
Copy link

I already have a canvas and currently convert it into a base64 png, give it to vibrant and it then draws it on a canvas once more. This seems a bit redundant.

@maxcr
Copy link

maxcr commented Jul 27, 2018

Canvas operations are cheap since they are done on the GPU and not CPU. If your demographic is mainly really old android and IE then I guess you could rewrite it to merge the two canvas operations somehow but if were talking amount of milliseconds decreased on compute time it would be a negligible performance gain for anything made after 2012.

@StephanBijzitter
Copy link
Author

If your demographic is mainly really old android and IE

Nail. Head. 😅

@maxcr
Copy link

maxcr commented Aug 2, 2018

I mean it seems that the WebAssembly implementation would solve the issue as that is the most performant state. Is the browser versions supported too old for WASM? If that's the case, it's going to take a lot of work but I'll take a look as soon as I figure out some other stuff.

@StephanBijzitter
Copy link
Author

The only browser we have to support that doesn't support WASM is IE11 (sadly that's still a large minority of our users). I'll see if I can find some time to work on HTMLCanvasElement as input, but it could take a few months 😅

@maxcr
Copy link

maxcr commented Aug 3, 2018

I'll see about cooking up a patch for you buddy. Do you mind hosting your code somewhere for me so I can see how you're doing everything?

@StephanBijzitter
Copy link
Author

Apologies for the late response, there's not really a way for me to host a sample repo as the codebase is a tad old and has a lot of external dependencies.

However in the end it's just a <canvas> element being painted on using FabricJS. They've got a lot of demos, perhaps those can be used instead? http://fabricjs.com/demos/

@crutchcorn
Copy link
Member

crutchcorn commented Feb 23, 2019

This seems like a logical feature request to me. @maxcr, has there been any work done by you on this subject matter? We'd love pull requests and I could help out with anything you might have. We're currently moving new development towards the develop monorepo structure, but if you already have code written for master, I can migrate that code manually like we did for #82

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

No branches or pull requests

3 participants