Trace is an application for transforming bitmaps into vector graphics using BitmapToVector library.
Перейти к файлу
Wiesław Šoltés 9088e02950 Add ViewModelBase 2022-09-29 10:28:06 +02:00
.github Add web version 2022-02-04 20:39:49 +01:00
images Update TraceGui.png 2021-03-27 20:31:30 +01:00
src Add ViewModelBase 2022-09-29 10:28:06 +02:00
.editorconfig Create .editorconfig 2021-07-18 14:17:39 +02:00
.gitattributes Initial commit 2021-03-24 20:47:04 +01:00
.gitignore Update .gitignore 2021-03-24 20:47:23 +01:00
Directory.Build.props Update Directory.Build.props 2022-08-20 01:42:07 +02:00
LICENSE Create LICENSE 2021-03-25 08:24:29 +01:00
NuGet.Config Create NuGet.Config 2022-08-05 13:00:03 +02:00
README.md Update README.md 2022-08-09 08:30:02 +02:00
Trace.sln Update Trace.sln 2022-08-05 13:00:09 +02:00
global.json Revert "Use net7.0" 2022-08-07 23:14:12 +02:00

README.md

Trace

Build status CI

GitHub release Github All Releases Github Releases

Trace is an application for transforming bitmaps into vector graphics using BitmapToVector library.

Usage

Turdsize

The turdsize parameter can be used to 'despeckle' the bitmap to be traced, by removing all curves whose enclosed area is below the given threshold. The current default for the turdsize parameter is 2. Its useful range is from 0 to infinity.

Turnpolicy

The turnpolicy parameter determines how to resolve ambiguities during decomposition of bitmaps into paths.

The possible choices for the turnpolicy parameter are:

  • Black: prefers to connect black (foreground) components.
  • White: prefers to connect white (background) components
  • Left: always take a left turn.
  • Right: always take a right turn.
  • Minority: prefers to connect the color (black or white) that occurs least frequently in a local neighborhood of the current position.
  • Majority: prefers to connect the color (black or white) that occurs most frequently in a local neighborhood of the current position.
  • Random: choose pseudo-randomly.

The current default policy is Minority, which tends to keep visual lines connected.

Alphamax

The alphamax parameter is a threshold for the detection of corners. It controls the smoothness of the traced curve. The current default is 1.0. The useful range of this parameter is from 0.0 (polygon) to 1.3334 (no corners).

Opticurve and opttolerance

The opticurve parameter is a boolean flag that controls whether Potrace will attempt to simplify the final curve by reducing the number of Bezier curve segments. Opticurve=1 turns on optimization, and opticurve=0 turns it off. The current default is on.

The opttolerance parameter defines the amount of error allowed in this simplification. The current default is 0.2. Larger values tend to decrease the number of segments, at the expense of less accuracy. The useful range is from 0 to infinity, although in practice one would hardly choose values greater than 1 or so. For most purposes, the default value is a good tradeoff between space and accuracy.

Fill color

The fill color used for generated output path's. The default is hex value #000000. It also accepts named colors like Red, Black etc.

Color filter

Color filter is an C# expression used to filter input bitmap colors. It has access to Rgba32 pixel sctruct represantion.

The default filter is c.R < 128 && c.A > 0 where c is variable of type Rgba32.

Available c variable properties:

  • c.R Red
  • c.G Green
  • c.B Blue
  • c.A Alpha

Building

Download and install .NET 5.0 SDK.

Build

dotnet build ./src/TraceGui/TraceGui.csproj -c Release

Run

dotnet run --project ./src/TraceGui/TraceGui.csproj -c Release

Licensing

Trace is licensed under the GPL-3.0 License.