Open MrBlenny opened 6 years ago
David, please check another library, it has more high-level classes: https://github.com/Wickedlasers/libLaserdockCore
Using JS for image conversion in realtime looks not very cool for real-time conversion. For your task it would be better to use OpenCV - get contours from image and convert them to laserdock points directly.
Instead of: html -> image -> svg -> ild -> laserdock
You'll get html -> image -> opencv contours conversion -> laserdock
Disadvantage is that you need to have OpenCV installed - I don't know if Chrome extension allows it.
Has the opencv contour -> laserdock conversion been done before? Can you outline the difference between the ild and laserdock formats?
PS: OpenCV can be installed as part of an electron app which is a good alternative to a chrome extension.
1) Yes, it is used in laserdock app
2) We use liblzr library for ILD file parsing and openlase library for image generation/optimisation. I meant this conversion. https://github.com/brendan-w/lzr/blob/master/liblzr/liblzr.hpp https://github.com/marcan/openlase/blob/master/libol/libol.c
Hey,
I've got an inclination to build a HTML5 canvas -> laser dock converter. This would be a chrome extension which find the canvas on a webpage, load some simple game-specific config and start sampling it and converting the canvas shapes/paths to the laserdock format. This would allow for a variety of simple web based games to be played, for example:
Is there additional documentation?
My current thinking:
toDataURL
is used to convert canvas to an imageI have not used these libs before so performance will be questionable. I suspect the bottleneck will be vectorising the rasters - this could be multi-threaded in node if need be. Does
laserdocklib
bring anything to the table here?