Inkscape tutorial: Tracing bitmaps

Inkscape

Tutorial | Tracing bitmaps

One of the features in Inkscape is a tool for tracing a bitmap image into one or more <path> elements for your SVG drawing. These short notes should help you become acquainted with how it works.

トレースの目的は、オリジナルの画像を忠実に再現することではなく、最終的な完成品を作成することでもないということを覚えておいてください。自動トレーサーにそんなことはできません。トレースがすることは、あなたが描く作品の一つの資源としての一連の曲線を提供することなのです。

Our tracer, derived from the original Potrace library by Peter Selinger, interprets a black and white bitmap, and produces a set of curves. For Potrace, we currently have three types of input filters to convert from the raw image to something that Potrace can use.

ほとんどの場合、Potrace は中間像のビットマップの色の濃いピクセルをより多くトレースします。トレース量が増えると、処理にかかる CPU 時間が増え、<パス> 要素は非常に多くなります。まずより色の薄い中間像で実験し、徐々に濃くして希望する割合や出力パスの複雑さを決めていくことをおすすめします。

To use the tracer, load or import an image, select it, and select the PathTrace Bitmap item, or Shift+Alt+B.

The user will see the five filter options available:

  • Brightness Cutoff

これは単にピクセルの赤、青、および緑 (またはグレーのシェード) の合計を黒あるいは白とみなす指標として使用しているだけです。しきい値は 0.0 (黒) から 1.0 (白) が設定できます。高いしきい値を設定すると、少数のピクセルだけが「白」とみなされ、中間像は濃くなります。

  • Edge Detection

これは類似するコントラストの平衡線を素早く検出する手段として、J. Canny が考案したエッジ検出アルゴリズムを使用しています。これは明るさのしきい値の結果よりもオリジナルの情報を残さない中間像を生成しますが、おそらく他では無視される曲線情報を提供します。ここでのしきい値の設定 (0.0 – 1.0) は出力に含むコントラストのエッジに隣接したピクセルを調節します。この設定で出力のエッジの暗さや太さを調整できます。

  • 色の量子化

このフィルターの結果は他の 2 つよりも大きく異なる中間像を生成しますが、実は非常に役に立ちます。これは明るさやコントラストの平衡線の代わりに、明るさやコントラストが同じであっても色が変わる境界を検出します。ここでは、中間像がカラーの場合に出力する色数を決定します。これが色が偶数か奇数かで白/黒を決定します。

これら 3 つのフィルターを試してみて、さまざまタイプの入力画像でさまざまなタイプの出力を見比べてください。

After tracing, it is also suggested that the user try PathSimplify (Ctrl+L) on the output path to reduce the number of nodes. This can make the output of Potrace much easier to edit. For example, here is a typical tracing of the Old Man Playing Guitar:

Note the enormous number of nodes in the path. After hitting Ctrl+L, this is a typical result:

描写はすこしだけ似ていてラフですが、描画はよりシンプルになり、編集しやすくなっています。トレースは画像を忠実に描写するのではなく、あなたが作品を描画する中で使用する一連の曲線を作成するものであることを忘れないでください。

  • Autotrace

The Autotrace option uses a different algorithm for tracing and also offers some other parameters to tweak. It may take a little longer to work, but gives you some variety to choose from.

  • Centerline tracing (autotrace)

If you would like to vectorize a line drawing, and get strokes that are easy to modify instead of filled areas as a result, use this option. It will attempt to find contiguous lines that make up your drawing.

Authors: Bulia Byak; Jonathan Leighton; Colin Marquardt; Nicolas Dufour; Gellért Gyuris; Maren Hachmann

Translators: Masato Hashimoto — 2009

Header / footer design: Esteban Capella — 2019