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

Export frame as image #822

Closed
thijstriemstra opened this issue Sep 15, 2016 · 6 comments
Closed

Export frame as image #822

thijstriemstra opened this issue Sep 15, 2016 · 6 comments

Comments

@thijstriemstra
Copy link
Contributor

An exportImage method that returns image data (png, etc) for the current wavesurfer frame would be useful.

@thijstriemstra
Copy link
Contributor Author

it would be good to have a getImage implementation for drawer.multicanvas.js as well. @chrisparton1991 can you take a look at that?

@chrisparton1991
Copy link
Contributor

@thijstriemstra, I don't know how feasible it is to add this to MultiCanvas. I'd need to get the data URLs from each canvas and stitch them together.

I've done some googling, and it seems the way to do this is typically to redraw the data URLs from each canvas onto a separate canvas, then re-export that canvas as a data URL. However, since the point of MultiCanvas is to overcome the size limitations of a single canvas, there wouldn't be much benefit to doing this. Thoughts?

@katspaugh
Copy link
Owner

katspaugh commented Sep 19, 2016

Since it would be good, at some point, to make MultiCanvas the default and remove the regular Canvas, I think the algorithm should be the same for both backends:

  • Check the size.
  • If the size is greater than a single canvas can handle, downscale.
  • Draw on a single canvas.
  • Export.

@thijstriemstra
Copy link
Contributor Author

It sounds like things will get a lot more complicated when MultiCanvas is introduced as the default, but I could be wrong. Maybe this ticket should be closed and a future ticket can introduce getImage support for multi-canvas.

@usfslk
Copy link

usfslk commented Aug 5, 2019

Hi, on wavesurfer docs there's exportImage(format, quality, type) can you please shed a light on those 3 parameters? I'm not sure what values I should use

@thijstriemstra
Copy link
Contributor Author

thijstriemstra commented Aug 5, 2019

Repository owner locked as resolved and limited conversation to collaborators Aug 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants