> [Site index](https://perfectvector.com/llms.txt) — available pages and descriptions.

# Potrace Turn Policy: Trace Separate Diagonal Paths

> Compare Potrace black, white, and minority turn policies on two pixel blocks that touch at a corner. Check which setting gives you separate SVG paths.

Source: https://perfectvector.com/blog/potrace-turnpolicy

Language: en
Author: Irene Kim
Published: 2026-11-23T08:00:00+09:00

Potrace’s **turn policy** decides how the tracer follows a boundary when dark and light pixels meet diagonally at one grid corner. Use `--turnpolicy white` to favor the light connection at that corner, or `--turnpolicy black` to favor the dark connection. Keep the source mask fixed while comparing them. [Potrace command reference](https://potrace.sourceforge.net/potrace.1.html)

Two traces can look alike and still contain different numbers of paths. That matters when a pair of marks needs to remain separately selectable or when the light space between them needs to survive later edits.

## Identify the ambiguous corner

Draw a 2 × 2 grid. Put black squares at the upper left and lower right, and white squares in the other two cells. All four cells touch at the center vertex. The boundary can turn there in either direction, which changes which color stays connected across the corner. The [Potrace algorithm paper](https://potrace.sourceforge.net/potrace.pdf) explains this path-decomposition step.

| Setting    | What it favors at an ambiguous corner                     |
| ---------- | --------------------------------------------------------- |
| `black`    | A connection between black pixels                         |
| `white`    | A connection between white pixels                         |
| `minority` | The locally less common color. This is Potrace’s default. |
| `majority` | The locally more common color                             |

The fixed `left` and `right` policies choose a turn direction. Start with black and white when your design gives you a clear foreground or background preference.

## Trace one bitmap with the same settings

The test uses Potrace and a plain-text PBM, a monochrome bitmap format. In PBM, 1 means black and 0 means white. Save this as `corner.pbm`. Its two 5 × 5 blocks meet at one corner. [Netpbm PBM specification](https://netpbm.sourceforge.net/doc/pbm.html)

```text
P1
12 12
0 0 0 0 0 0 0 0 0 0 0 0
0 1 1 1 1 1 0 0 0 0 0 0
0 1 1 1 1 1 0 0 0 0 0 0
0 1 1 1 1 1 0 0 0 0 0 0
0 1 1 1 1 1 0 0 0 0 0 0
0 1 1 1 1 1 0 0 0 0 0 0
0 0 0 0 0 0 1 1 1 1 1 0
0 0 0 0 0 0 1 1 1 1 1 0
0 0 0 0 0 0 1 1 1 1 1 0
0 0 0 0 0 0 1 1 1 1 1 0
0 0 0 0 0 0 1 1 1 1 1 0
0 0 0 0 0 0 0 0 0 0 0 0
```

```sh
for policy in black white minority; do
  potrace corner.pbm --svg --turnpolicy "$policy" \
    --turdsize 0 --alphamax 0 --output "$policy.svg"
done
```

The two fixed flags keep the corner comparison simple. `--turdsize 0` disables speckle removal, and `--alphamax 0` makes the output polygonal. Compare the saved SVGs in the same editor and expand their group in the object list. Alternatively, open them as text and count the `<path>` elements for this fixture.

In Potrace 1.16, black and minority each produced one closed path. White produced two independently selectable closed paths. Both white paths retain the corner point in this test, so they can still look like they touch. Use a geometric gap in the input if the deliverable requires physical separation.

![A corner-touching bitmap beside Potrace output with one path for black policy and two paths for white policy](https://perfectvector.com/blog/potrace-turnpolicy/workflow-proof.webp)

*The same bitmap traced with black and white turn policies. Display colors identify separate path objects without changing their geometry.*

## Diagnose a merge that persists

Check the thresholded bitmap first. If the dark shapes already share a pixel edge, the turn policy cannot create a gap there. Clean up that border in the bitmap or adjust the threshold, then rerun your comparison. The [Potrace PNG preparation guide](https://perfectvector.com/blog/potrace-png-to-svg) covers the conversion from PNG to a mask. If two shapes still look like one, use the [trace quality checklist](https://perfectvector.com/blog/evaluate-vector-trace-quality) to inspect the exported objects and openings.

## FAQ

### What is Potrace’s default turn policy?

Potrace defaults to minority. At an ambiguous corner, it favors the color that occurs less often in the local neighborhood.

### Can turn policy change a shape where pixels share an edge?

Turn policy resolves ambiguous turns at a boundary vertex. To split shapes already joined along an edge, change the mask so they have separate boundaries.

### Does the white policy create clearance between two shapes?

It can produce separate paths for corner-touching dark areas. In this sample, those paths still touch at a point. For positive clearance, introduce a gap in the source and measure it in the output.

## Start with the original raster

PerfectVector can trace a raster image into editable vector paths.

If you have only the original PNG or JPG, [preview a vector trace](https://perfectvector.com/image-to-vector) and check the corner at zoom. Inspect the path list before you decide whether the marks need to be drawn apart.

## Sources

1. [Potrace command reference](https://potrace.sourceforge.net/potrace.1.html) — Turn-policy values, defaults, and tracing flags.
2. [Peter Selinger, Potrace algorithm paper](https://potrace.sourceforge.net/potrace.pdf) — Ambiguous grid vertices and path decomposition.
3. [Netpbm PBM specification](https://netpbm.sourceforge.net/doc/pbm.html) — Pixel values and the plain PBM input format.

## Explore

- [Read the HTML article](https://perfectvector.com/blog/potrace-turnpolicy)
- [Tune Potrace Curve Tolerance for Simpler SVG Paths](https://perfectvector.com/blog/potrace-opttolerance.md)
- [VTracer PNG to SVG: Check Colors and Small Details](https://perfectvector.com/blog/vtracer-png-to-svg.md)
- [Product facts](https://perfectvector.com/product-facts.md)
- [FAQ](https://perfectvector.com/faq.md)
- [Pricing and credits](https://perfectvector.com/pricing.md)
