foo123 / FILTER.js

Video and Image Processing and Computer Vision Library in pure JavaScript (Browser and Node.js)
https://foo123.github.io/examples/filter/
393 stars 45 forks source link

PatternFloodFill on SVG image #13

Closed karims closed 1 year ago

karims commented 7 years ago

As far as I can see code and documentation, this library is not ready yet for SVG images.

I am looking for efficient pattern fill algorithm over svg. The pattern fill given here is amazingly fast. I want to use the same over canvas, filling inside SVG paths.

Is that possible? Even if I have to take the plugin out or otherwise. Let me know, it will be helpful. I am trying to see if I can add SVG support to the library. I might take time on that.

foo123 commented 7 years ago

Hi there, no i dont think this will work for svg images. There is a plan to add svg filters support (that is native svg) but this i cannot do at this time. i have no idea how this can wok with svg images however. Feel free to fork and modify if you like. Maybe if you want to fill over svg paths, svg masking might be an option, dont know. The pattern fill works with given color, or hue or similar (that is the area to be filled, or the border of the area have a specific color). See if that helps

karims commented 7 years ago

Thanks a lot for the help. I am using your library and it works efficiently even on client side.

I know this library is not supported on safari right now. Any plans for this? Is there a workaround right now which I can use to make it work on safari?

karims commented 7 years ago

The error i get is: SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.

foo123 commented 7 years ago

No sorry, i dont have safari (i use windows right now) and i dont see up-to-date safari for windows anywhere. However given that safari uses webkit it should work good enough, havent tested

foo123 commented 1 year ago

If you are still interested I have implemented recently a Rasterizer library (browser/node) that implementes canvas fill algorithm.