ZeaInc / zea-svelte-template

This Svelte Template is a preconfigured Svelte app that combines the engine and many of the popular plugins.
https://www.zea.live/en/ecosystem/svelte-template
MIT License
0 stars 0 forks source link

Generate Vectorized 2D image from Canvas. #35

Open phtaylor opened 3 years ago

phtaylor commented 3 years ago

image

https://community.zea.live/t/create-2d-snapshot/86/2

  1. Start by simply adding a 'savePNG' method that generates a PNG from the current viewport, previewing it in an overlay, and allowing the user to download it.

    var img = new Image();
    img.src = renderer.getGLCanvas().toDataURL('image/png');
    img.onload = function() {
       // Do post processing on the image.
    }

    Export some sample files to PNGs for the next step.

  2. Research the various vectorization tools available in npm.

Manually process the sample files to SVG and try to find the best tool for the job. Integrate the vectorizer tool into the SvelteApp and maybe allow users to see the SVG image in the overlay. (Maybe they can select a 'vectorize' option. There could be some settings).

  1. Allow the user to download the SVG.