• Stars
    star
    240
  • Rank 168,229 (Top 4 %)
  • Language
    Python
  • License
    GNU General Publi...
  • Created about 10 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A bitmap vectorizer that can trace along the centerline of a stroke. The builtin inkscape 'trace bitmap' can only trace edges, thus resulting in double lines for most basic use cases. It uses 'autotrace -centerline' and an optimal threshold to vectorize a pixel image.

inkscape-centerline-trace

A bitmap vectorizer that can trace along the centerline of a stroke. The builtin inkscape 'trace bitmap' can only trace edges, thus resulting in double lines for most basic use cases.

Download Source code and Debian/Ubuntu package

NOTE: This is python2 code. It was developed and tested with inkscape-0.92.3 -- It probably does not run with inkscape 1.0.1 and should not be needed. Inkscape 1.0.1 has the feature built-in under Path -> Trace Bitmap -> Centerline tracing (autotrace)

Written with python-Pillow. It uses 'autotrace -centerline' and an optimal threshold to vectorize a pixel image. See centerline-tracing.svg for an illustration of the idea.

In inkscape it shows up under Extensions -> Images -> Centerline Trace ...

Installation hints

  • Install the extension (all operating systems)

    • the extension requires the installation of autotrace and python-pil (see below)
    • grab a binary package or
    • download the zip file of inkscape-centerline-trace and unpack it
    • copy the files centerline-trace.inx, centerline-trace.py to your Inkscape User extensions folder (see Edit > Preferences > System: System info: User extensions)
  • Install autotrace / python-pil

    • Windows
    • MacOS
      • Install autotrace MacOS.zip version 0.40.0 or later from e.g. https://github.com/autotrace/autotrace/releases
      • open a command line shell to install the python-PIL module:
        • sudo easy_install install pip
        • sudo pip install pillow
      • open a command line shell to install the inkscape extension:
        • cd ~/.config/inkscape/extensions
        • curl https://raw.githubusercontent.com/fablabnbg/inkscape-centerline-trace/master/centerline-trace.py -o centerline-trace.py
        • curl https://raw.githubusercontent.com/fablabnbg/inkscape-centerline-trace/master/centerline-trace.inx -o centerline-trace.inx
      • Please report success in the github issues. As of 2018-08-31, MacOS Support is back, but highly experimental.
    • GNU/Linux
      • Install the autotrace DEB package version 0.40.0 or later from e.g. https://github.com/autotrace/autotrace/releases
      • if you do not have pillow/pil installed, the extension will output an error message prompting you to install it. On Ubuntu and derivatives, run sudo apt-get install python-pil to install.
  • Finally, restart inkscape, and find CenterlineTrace in the Extensions -> Images menue.

  • Since Inkscape 1.0 the Autotrace library including the CenterlineTrace feature is integrated. That should obsolete this extension. Find an entry in the new Path -> Trace Bitmap dialog.

Algorithm

The input image is converted to a graymap and histogram normalized with PIL.ImageOps.autocontrast. Optional preprocessing: equal illumination, median denoise filter.

Autotrace needs a bi-level bitmap. In order to find the best threshold value, we can run autotrace at multiple thresholds and evaluate the result candidates.

We count the number of line segments produced and measure the total path length drawn. The svg that has the longest path but the least number of segments is returned.

More Repositories

1

inkscape-silhouette

An extension to drive Silhouette vinyl cutters (e.g. Cameo, Portrait, Curio series) from within inkscape.
Python
490
star
2

inkscape-chain-paths

Make longer continuous paths from shorter path segments
Python
32
star
3

tronxy-xy100

Working with an inexpensive 3D printer, Other names: STARTT (from imakr.com) or Anet A8
Python
25
star
4

OpenWordClock

Arduino
22
star
5

TRGBArduinoSupport

Basic support (arduino and platformio) for T-RGB device
C
12
star
6

EspWebServo

An rc-servo controlled by an ESP8266 via wifi commands.
C
10
star
7

inkscape-text2hershey

Convert normal text lines or flow text into hershey fonts
Python
4
star
8

gossen_m701x

serial interface code for the Gossen Metrawatt M701x SECUTEST Family
Python
4
star
9

3D-Scanner-Turntable

Controlling our fancy turntable at the 3D scanner
3
star
10

RFID_CardReader

A device to read member cards and activate peripheral devices.
C++
3
star
11

ScreenPrintSeparator

A script based on ImageMagick to convert a RGB jpg to separated halftone dithered images, ready to print on foil (for screen printing)
3
star
12

visicut-settings

Visicut settings used in FabLab Nรผrnberg
HTML
2
star
13

inkscape-gridstripcreator

Creates grid strip for the qlocktwo
Python
2
star
14

ZauberBoxOp

A "ZauberBox" with Buttons - Software uses final state machines to send various commands via MQTT
C++
2
star
15

xxl-cnc-heissdraht

C
2
star
16

OpenPhotonik_Makeathon2020

Make-athon von OpenPhotonic, November 2020
Python
2
star
17

neato-drive

Python library to drive a neato botvac d85
Python
2
star
18

DIY-Microscope

The FABroscope: A cheap webcam converted into a microscope with a lasercut stage assembly.
2
star
19

tinyboy

Working with a tinyboy fabricator
G-code
2
star
20

KnightRider

Arduino LED - KnightRider - LED control sketch
C++
1
star
21

MiniTurntable

A small lasercut turntable with an inexpensive gear, optionally solar powered.
1
star
22

eagle

Eagle
1
star
23

fablabnbg.github.io

GitHub Pages Repo
HTML
1
star
24

fuco

OpenSCAD
1
star
25

ElektronikLab

https://github.com/ElektronikLab
HTML
1
star
26

aussentueren

Hard- and Software for external doors of Hackerspaces
Python
1
star
27

lumitile

Revival of LumiTile hardware with new software
HTML
1
star
28

ReliefClock

A 7 segment display that moves segments forward instead of changing color
1
star
29

ESP_HomieRollerShutter

Rollershutter control for ESP8266 with automaton framework and MQTT Homie Convention
C++
1
star
30

door_access

Python
1
star
31

Matomat2

Community Banking System
Python
1
star
32

ESP_HomieCCS811Node

Library to adapt a CCS811 CO2 Sensor to the Homie MQTT Convention (for ESP8266 / ESP32)
C++
1
star
33

airco2ntrold

Python
1
star