I want to program a 2D animation tool that works somewhat like Toon Boom. I was sitting in math class this morning (not paying attention) and it dawned on me how Toon Boom, and as far as I can tell Inkscape, handles brush strokes. It appears to me that the brush sets pixels in raster format, like a typical paint program would, and then when the mouse button is released or the stylus pressure reaches zero, the pixels are vectorized. I know there are programs out there that can vectorize raster graphics, but I can't find any examples of how to program it.
Am I correct that Inkscape vectorizes raster brush strokes? If not, how does it work? If so, where can I learn how to make my program do that? Thanks.
How does inkscape vectorize a brush stroke?
Re: How does inkscape vectorize a brush stroke?
I don't know, but I didn't think that Inkscapes brush uses raster and converts to vector ( does though). But if it does, it's using this code http://potrace.sourceforge.net/
Re: How does inkscape vectorize a brush stroke?
No, this is not how Inkscape creates a brush stroke. the only place that vectorising via potrace is used is by the fill bucket tool ( ) or by path->trace bitmap.
Assuming that when you say "brush strokes" you mean the calligraphy tool ( ) how it works (or at least how I *think* it works as I am not a developer) is by recording the mouse position after a time interval, along with the width needed as determined by the width setting, tracing setting and stylus pressure. It then takes two points normal to the direction of movements and adds the control points there. Have a look for yourself while using the tool. you will see the previous line drawn and then a red section which represents the last section of the path recorded.
If you meant how the pencil tool works, I don't really know, but I think it records a list of mouse positions, then depending on smoothness settings, will fit a line between them. Something like how "connect the dots" drawings work, although this is all guesswork really If you need anymore, have a look at http://inkscape.svn.sourceforge.net/vie ... iew=markup or the draw context stuff in the source control...
Hope that helps, and I hope I haven't got anything *too* wrong
Assuming that when you say "brush strokes" you mean the calligraphy tool ( ) how it works (or at least how I *think* it works as I am not a developer) is by recording the mouse position after a time interval, along with the width needed as determined by the width setting, tracing setting and stylus pressure. It then takes two points normal to the direction of movements and adds the control points there. Have a look for yourself while using the tool. you will see the previous line drawn and then a red section which represents the last section of the path recorded.
If you meant how the pencil tool works, I don't really know, but I think it records a list of mouse positions, then depending on smoothness settings, will fit a line between them. Something like how "connect the dots" drawings work, although this is all guesswork really If you need anymore, have a look at http://inkscape.svn.sourceforge.net/vie ... iew=markup or the draw context stuff in the source control...
Hope that helps, and I hope I haven't got anything *too* wrong