## Pixel types

A central vectorization problem is how best to handle junctions.

ShapeLogic has approached the problem by developing an extensive catalogue of different pixel types.

### Pixel type catalogue

• P: Normal point, 2 neighbors, cross index of 4
• E: End or extreme point, 1 neighbor, cross index of 2
• N: More neighbors, more than 2 neighbors, cross index of 4
• J: Junction point, more than cross index of 4
• L: L corner, 2 neighbors with modulo distance either 2 or 6, cross index of 4
• V: A corner, 2 neighbors, cross index of 2, should always be next to a junction
• B: Border of solid, cross index of 2
• S: Solid, 8 neighbors or 7 where the last on is an even number.

## Pixel types examples

### Junctions

``` P P    P
J     P
P     N
P   PNJNP
E     N```

### Corners

``` P
N
VJNPP

P
N
LNP```
``` P
N
VJNPP```

### V points

V points are angle junctions (as in the letter "V")

```   P
N
VJNPPE

P
N
VJNPPE
N
P

P
N
VJNPPE
NN
P P```

#### Problematic V point

```  P  P
N P
JN
V```

### N points

N points have more than 2 neighbors, but can only be traversed in one reasonable way.

``` P  P
NN
NN
P  P

P P
NN
NN
P P```

### Edge and inner points

Edge and inner points are not yet handled in ShapeLogic.

``` BBBB
BSSB
BBBB```
``` BBB
BSSB
BBBB```
``` BBB B
BSSBB
BBBBB```
``` BBBBB
BB BB
BBBBB```