FILTER.js icon indicating copy to clipboard operation
FILTER.js copied to clipboard

PatternFloodFill on SVG image

Open karims opened this issue 7 years ago • 4 comments

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.

karims avatar Mar 07 '17 13:03 karims

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

foo123 avatar Apr 15 '17 09:04 foo123

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 avatar Jun 13 '17 14:06 karims

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

karims avatar Jun 13 '17 14:06 karims

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 avatar Jun 22 '17 08:06 foo123

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

foo123 avatar Aug 11 '23 06:08 foo123