GSoC19 : Vectorization of bitmaps


I will be updating about the progress of the project here :slight_smile:


Weekly progress(18-25 May):

  1. :heavy_check_mark: class RawBorderPoint
    main variable being TPoint m_position; We have synfig pointint that can replace Tpoint

  2. :heavy_check_mark: class RawBorder final : public std::vector
    main variable being TpointD We have synfig point that can replace TpointD

  3. :heavy_check_mark: class PixelEvaluator //this is a template class
    main variable being TRasterPT

  4. :heavy_check_mark: class Signaturemap
    main data being the functions

  • Signaturemap(const TRasterP &ras, int threshold) and
  • template <typename T> void readRasterData(const TRasterPT<T> &ras, int threshold);

Along with some other functions that directly or indirectly use data objects of mentioned classes
So in the next week, I will be focusing on creating Synfig equivalent of polygonizer
I appreciate any suggestions or improvements from anyone :slight_smile:

EDIT: I will be adding (:heavy_check_mark: ) to the one I have implemented.


Awesome! Keep up the good work! :slight_smile:


I have this program maybe serves them of reference. It can work with flat colours.


@bazza thank you :slight_smile:
but this uses potrace however I am not using potrace(although It was an option) you can see the discussion on that here


@KonstantinDmitriev I have implemented 2 classes(see edited comment).
Please have a look at


Currently I’m stuck on the PixelEvaluator class. It uses pixel information and then decides whether it is can be categorized as a black pixel or a white one.

The problem is Synfig uses RGBA color scheme and Toonz uses RGBM color scheme so I’m not sure if can simply replace the A with M into the same formula.
I found that GIMP uses 5 different method for the same (in desaturate).
Out of them luminance is most accurate according to documentation. So I’m thinking of using it.


Weekly progress(26 -1 June):



Weekly Progress(2 - 8 June):

I appreciate any feedback! [^_^]
Ankit Dwivedi


Weekly Progress(9 - 15 June):

  • Rectified the errors present in centerlinepolygonizer
  • I was able to pass the output of centerlinepolygonizer to Toonz and got the output(which was rotated 90-degrees anticlockwise)
  • Fixed the rotated input error mentioned in the above point
  • Started the work on centerlineskeletonizer which is almost complete(at least the code is compiling successfully :p)
  • Will try to check the output of centerlineskeletonizer by passing it results to Toonz.
  • In the next week I look forward to making the centerlineskeletonizer working

That’s all for this week [^_^]
Would appreciate Suggestions and feedbacks


A comparison between the output of Skeletonizer from Toonz and Synfig can be seen here however the results are not exactly the same but of the same nature.

  • I need to cross check if I have made any silly error and cross verify them again(for this time I need to pass the output of synfig skeletonizer to toonz to see if the result is varied which I am still figuring out a way on how to do that).

  • Have started working on the next step which is creating the complete skeleton using joints and sequence from separate straight skeletons.

feedback and suggestions are always welcome


Weekly Progress(16 - 22 June):

  • This week I was able to complete the Skeletonizer that output a straight skeleton.
  • And then I started working on organizegraphs() which joins the straight skeletons into sequences and joints. And I was able to achieve the same
  • @KonstantinDmitriev helped me understand the concept of frame in calculating thickness ratio and that m_thicknessRatio = 1.0 in our case. (see discussion here)
  • The next step is storing the corresponding color for a sequence in the skeleton for which I the plan is to extract the original RGBA color from the bitmap layer and then apply the color as a “Stroke” ( as they say in Toonz) but we do not have strokes so Outline layer will be used.

The progress of this project can now be seen here
For people who want to get a quick insight into the centerline vectorization algorithm can see this comment.

Any suggestions or feedback are welcome :slight_smile: