Answers.Body: <p>If we seek proven working source code to plug into a GPLv2-licence compatible solution, we should at least consider autotrace. Its <a href="https://sourceforge.net/projects/autotrace/files/AutoTrace/0.31.1/autotrace-0.31.1-1.dag.8.0.src.rpm/download" rel="nofollow noreferrer">source code</a> is open for review. It can be tested against the example images we have and, if it works fine, called by our GPLv2 software. We can even use the calling code in <a href="https://gitlab.com/inkscape/inkscape/blob/master/src/trace/autotrace/inkscape-autotrace.cpp" rel="nofollow noreferrer">Inkscape's plug-in image tracing implementation</a> as a good starting point for design and implementation of our calling program, whether it be C, C++, Java, Python, or ECMA (JS).</p>
  
  <p>The trace algorithm in Adobe Illustrator is comparable but is not open source.</p>
  
  <p>If we seek theory, there are several academic publications discussing some of the theory, the last being most aligned with machine learning ideology. I would not dismiss earlier work simply because it doesn't connect with the current machine learning idioms. Investigating what is fully implemented and successfully used by many follows a wise old business proverb: The bird in the hand is worth two in the bush.</p>
  
  <ul>
  <li><p><a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.159.5801&amp;rep=rep1&amp;type=pdf" rel="nofollow noreferrer">Potrace: a polygon-based tracing algorithm</a>, Peter Selinger, 2003</p></li>
  <li><p><a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.109.2128&amp;rep=rep1&amp;type=pdf" rel="nofollow noreferrer">Vector Representation of Binary Images Containing Halftone Dots</a>, Kei Kawamura, Hiroshi Watanabe, Hideyoshi Tominaga, 2004</p></li>
  <li><p><a href="https://core.ac.uk/download/pdf/38053960.pdf" rel="nofollow noreferrer">Testing AutoTrace:
  A Machine-learning Approach to Automated
  Tongue Contour Data Extraction</a>, Jae-Hyun Sung, Jeff Berry, Marissa Cooper, Gustave Hahn-Powell, and Diana Archangeli, 2013</p></li>
  </ul>
  
  <p>Many of the online drawing programs collect data.  It would not be surprising if, behind the gracious give-away of online bandwidth, they are establishing a continuously improving data set for training a new breed of autotracers.  None have published AI designs admitting as much, but they would not be legally obligated to do so because a single input example is indeterminable from the autotrace service that could resulting from the training.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-12-06T13:26:50.363Z
Answers.Text: Thanks a lot! My question contains two questions: 1. How to trace bitmaps (and you answered very well), and 2. Is there a deep learning architecture fitted for this problem? I am very curious about this second question since it could help me understand what is possible to do with deep learning and what is not, and why. Tracing bitmaps is a perfect example of converting sparse data to a dense abstract representation ; I have the intuition one can learn a lot from this problem.
Answers.UserDisplayName: arthur.sw
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-24T17:47:11.057Z
Answers.LastActivityDate: 2019-11-24T23:05:09.467Z
Answers.LastEditDate: 2019-11-24T23:05:09.467Z
Answers.UserDisplayName: Douglas Daseeco
Answers.Body: <p>any luck update in this. I fully understand
  And today, I can tell u that my research has led me here, and that bitmap tracing for simple lines is so so so trash still after decades,
  And I have been a graphic designer for bout 20 years now.
  So anyway.im also a low level- mid level developer u could say,
  And for so many years I have been thinking of different ways to help solve this problem.
  And I dont know</p>
  <p>But can some1 please advise me if this method could work</p>
  <p>Though it's incomplete I'm hoping I'm on the right path and someone could add to it</p>
  <p>Would it be effective to</p>
  <p>Train a model on a dataset of bitmaps and it's corresponding SVG that will contain the max amount of points
  And % similarity average to the the bitmap
  (This idea stems around the thought of training a diffuser or something)</p>
  <p>Then</p>
  <p>Train another model(or something)
  On the same bitmaps dataset
  Though the corresponding SVG in this data set will be simplified to the least amount of paths and still within the same % similarity average to the bitmap</p>
  <p>So that should simplify the paths and still look like the original
  (Obviously not theoretically because I'm not actually sure)</p>
  <p>So now when you run this against a bitmap u want to vectorize</p>
  <p>I think maybe
  Tiling the bitmap
  Scan all the tiles
  Reproduce that tile bitmap and corresponding SVG overlay
  with the trained model that produces the most points</p>
  <p>And then stich the tiles back together
  And apply a final simplify using the
  Model trained with the least points</p>
  <p>OK so as muddled as that all is really..
  I'm hoping someone can understand that.
  And either tell me to shut up.</p>
  <p>Or any help to develop this idea further or,</p>
  <p>If you need a visual representation of what I'm trying to say, in order to understand it
  I can draw up something and send it</p>
  <p>But really this has been a life long goal..</p>
  <p>I would honestly design the entire dataset
  Just to shape the model to spec.</p>
  <p>Or am I just way off the mark here</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-04T08:40:56.453Z
Answers.Text: As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answers.UserDisplayName: Community
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-02-26T20:50:41.063Z
Answers.LastActivityDate: 2023-02-26T20:50:41.063Z
Answers.UserDisplayName: Kaaneii Williams
Body: <p>I need an algorithm to <a href="https://en.wikipedia.org/wiki/Image_tracing" rel="nofollow noreferrer">trace simple bitmaps</a>, which only contain paths with a given stroke width.</p>
  <p><strong>Is there any existing attempt to create a deep learning model which extracts vector paths from bitmaps?</strong></p>
  <p>It is obviously very easy to generate bitmaps from vector paths, so creating data for a machine learning algorithm is simple.  The model could be trained by giving both the vector and bitmap representation. Once trained, it would be able to generate the vector paths from the given bitmap.</p>
  <p>This seems simple, but I could not find any work on this particular task. So, I suppose this problem is not fitted for current deep learning architectures, why?</p>
  <p>The goal is to trace this kind of image, which would be drawn by hand with a thick felt pen and scanned:</p>
  <p><img src="https://i.sstatic.net/xZX3N.png" alt="Bitmap Image containing simple vector paths" /></p>
  <p><strong>So, is there a deep learning architecture fitted for this problem?</strong></p>
  <p>I believe this question could help me understand what is possible to do with deep learning and what is not, and why. Tracing bitmaps is a perfect example of converting sparse data to a dense abstract representation; I have the intuition one can learn a lot from this problem.</p>
  
Tags: <deep-learning><image-processing><algorithm-request><model-request>
Title: Is there any existing attempt to create a deep learning model which extracts vector paths from bitmaps?
UserDisplayName: arthur.sw
ThreadText: # Is there any existing attempt to create a deep learning model which extracts vector paths from bitmaps?
  
  (Asked by: username_0 on 2019-11-20)
  
  I need an algorithm to [trace simple bitmaps](https://en.wikipedia.org/wiki/Image_tracing), which only contain paths with a given stroke width.
  
  **Is there any existing attempt to create a deep learning model which extracts vector paths from bitmaps?**
  
  It is obviously very easy to generate bitmaps from vector paths, so creating data for a machine learning algorithm is simple. The model could be trained by giving both the vector and bitmap representation. Once trained, it would be able to generate the vector paths from the given bitmap.
  
  This seems simple, but I could not find any work on this particular task. So, I suppose this problem is not fitted for current deep learning architectures, why?
  
  The goal is to trace this kind of image, which would be drawn by hand with a thick felt pen and scanned:
  
  ![Bitmap Image containing simple vector paths](https://i.sstatic.net/xZX3N.png)
  
  **So, is there a deep learning architecture fitted for this problem?**
  
  I believe this question could help me understand what is possible to do with deep learning and what is not, and why. Tracing bitmaps is a perfect example of converting sparse data to a dense abstract representation; I have the intuition one can learn a lot from this problem.
  
  **Tags:** deep-learning, image-processing, algorithm-request, model-request
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-11-24. Score: 4
  
  If we seek proven working source code to plug into a GPLv2-licence compatible solution, we should at least consider autotrace. Its [source code](https://sourceforge.net/projects/autotrace/files/AutoTrace/0.31.1/autotrace-0.31.1-1.dag.8.0.src.rpm/download) is open for review. It can be tested against the example images we have and, if it works fine, called by our GPLv2 software. We can even use the calling code in [Inkscape's plug-in image tracing implementation](https://gitlab.com/inkscape/inkscape/blob/master/src/trace/autotrace/inkscape-autotrace.cpp) as a good starting point for design and implementation of our calling program, whether it be C, C++, Java, Python, or ECMA (JS).
  
  The trace algorithm in Adobe Illustrator is comparable but is not open source.
  
  If we seek theory, there are several academic publications discussing some of the theory, the last being most aligned with machine learning ideology. I would not dismiss earlier work simply because it doesn't connect with the current machine learning idioms. Investigating what is fully implemented and successfully used by many follows a wise old business proverb: The bird in the hand is worth two in the bush.
  
  * [Potrace: a polygon-based tracing algorithm](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.159.5801&rep=rep1&type=pdf), Peter Selinger, 2003
  * [Vector Representation of Binary Images Containing Halftone Dots](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.109.2128&rep=rep1&type=pdf), Kei Kawamura, Hiroshi Watanabe, Hideyoshi Tominaga, 2004
  * [Testing AutoTrace:
    A Machine-learning Approach to Automated
    Tongue Contour Data Extraction](https://core.ac.uk/download/pdf/38053960.pdf), Jae-Hyun Sung, Jeff Berry, Marissa Cooper, Gustave Hahn-Powell, and Diana Archangeli, 2013
  
  Many of the online drawing programs collect data. It would not be surprising if, behind the gracious give-away of online bandwidth, they are establishing a continuously improving data set for training a new breed of autotracers. None have published AI designs admitting as much, but they would not be legally obligated to do so because a single input example is indeterminable from the autotrace service that could resulting from the training.
  
  > **Comments:**
  > **username_0**: Thanks a lot! My question contains two questions: 1. How to trace bitmaps (and you answered very well), and 2. Is there a deep learning architecture fitted for this problem? I am very curious about this second question since it could help me understand what is possible to do with deep learning and what is not, and why. Tracing bitmaps is a perfect example of converting sparse data to a dense abstract representation ; I have the intuition one can learn a lot from this problem.  
  
  ---
  
  ### Answer by username_2 on 2023-02-26. Score: -1
  
  any luck update in this. I fully understand
  And today, I can tell u that my research has led me here, and that bitmap tracing for simple lines is so so so trash still after decades,
  And I have been a graphic designer for bout 20 years now.
  So anyway.im also a low level- mid level developer u could say,
  And for so many years I have been thinking of different ways to help solve this problem.
  And I dont know
  
  But can some1 please advise me if this method could work
  
  Though it's incomplete I'm hoping I'm on the right path and someone could add to it
  
  Would it be effective to
  
  Train a model on a dataset of bitmaps and it's corresponding SVG that will contain the max amount of points
  And % similarity average to the the bitmap
  (This idea stems around the thought of training a diffuser or something)
  
  Then
  
  Train another model(or something)
  On the same bitmaps dataset
  Though the corresponding SVG in this data set will be simplified to the least amount of paths and still within the same % similarity average to the bitmap
  
  So that should simplify the paths and still look like the original
  (Obviously not theoretically because I'm not actually sure)
  
  So now when you run this against a bitmap u want to vectorize
  
  I think maybe
  Tiling the bitmap
  Scan all the tiles
  Reproduce that tile bitmap and corresponding SVG overlay
  with the trained model that produces the most points
  
  And then stich the tiles back together
  And apply a final simplify using the
  Model trained with the least points
  
  OK so as muddled as that all is really..
  I'm hoping someone can understand that.
  And either tell me to shut up.
  
  Or any help to develop this idea further or,
  
  If you need a visual representation of what I'm trying to say, in order to understand it
  I can draw up something and send it
  
  But really this has been a life long goal..
  
  I would honestly design the entire dataset
  Just to shape the model to spec.
  
  Or am I just way off the mark here
  
  > **Comments:**
  > **username_3**: As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer).  
  
  ---
  
  