inkscape-centerline-trace

一个位图矢量化器,可以沿着笔画的中心线追踪。inkscape 内置的 "追踪位图" 只能追踪边缘,因此在大多数基本使用情况下会产生双线。它使用 "自动追踪中心线" 和最佳阈值来矢量化像素图像。「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.」

  • 所有者: fablabnbg/inkscape-centerline-trace
  • 平台: Linux,Mac,Windows
  • 许可证: GNU General Public License v2.0
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

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

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.

主要指标

概览
名称与所有者fablabnbg/inkscape-centerline-trace
主编程语言Python
编程语言Python (语言数: 4)
平台Linux, Mac, Windows
许可证GNU General Public License v2.0
所有者活动
创建于2014-10-27 00:39:46
推送于2020-11-26 17:56:42
最后一次提交2020-11-26 18:56:41
发布数14
最新版本名称v0.8c (发布于 )
第一版名称v0.2 (发布于 )
用户参与
星数261
关注者数20
派生数35
提交数98
已启用问题?
问题数33
打开的问题数9
拉请求数8
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?