Corner angle and Corner span decide which points on a traced outline are corners: the points where smoothing stops and the outline may turn sharply. Each shape is judged at its own scale, so the tip of a leaf counts and a speck of roughness on a wall does not.
What it does
- “Corner angle” (30°–150°, default 60°): how sharply the outline must turn to count as a corner. The turn is a change of direction: 0° runs straight on, 90° is a right angle, 180° doubles back.
- “Corner span” (0.5%–10% in steps of 0.5, default 2%): over how much of the shape that turn is measured, as a percentage of the shape's size, the diagonal of its bounding box.
At the defaults the corners of a square (a turn of 90°) and of a triangle (at least 60°, and 120° for an equilateral one) count, the corners of an octagon (45°) do not, and a regular hexagon's, which turn exactly 60°, sit right on the line.
From the span setting the tracer works out a distance along the outline, the span: the chosen share of the shape's size, never less than 4 pixels (twice the reach of the staircase smoothing) and never more than an eighth of the way around the outline. Then it tests every point on the outline twice:
- The sides. It takes the direction of the outline over the stretch from two spans to one span before the point, and the direction over the stretch from one span to two spans after it, and measures the angle between them. Because this looks beyond the point itself, a corner whose tip the pixel grid has rounded still reads at its true angle, and a wiggle shorter than a span is not seen at all.
- The wider turn. It measures the turn at the point between the lines to the outline two spans before it and two spans after it.
A point that turns by at least the “Corner angle” in both tests is a candidate. Candidates cluster around a real corner, so of all the candidates within a span of each other, one is kept: the tip, the one standing farthest from the straight line across the bend.
Corners do three things. Smoothness never reaches across them. Each gets two independent handles, so the outline can change direction there. And where both sides of a corner turn out straight, the corner is set where those two lines cross. With “Preview” on “Outlines”, every corner found is marked with a small square, so you can tune the two controls before you trace.
Lower the angle or the span and more corners appear: the outline becomes a chain of short runs, each fitted on its own, and it starts to look faceted. Raise them and fewer survive: the tip of a leaf or the tooth of a gear may be rounded into a curve.
Why it works this way
Every corner test on a traced line has a problem of scale. Look closely enough and a pixel edge is all corners: every step of the staircase turns 90°. Stand far enough back and a jagged coastline is a gentle curve. There is no right answer without a scale, so the tracer lets you choose one and ties it to each shape: the span is a share of the shape's own size. A 3-pixel jag on a shape 800 pixels across is measured over a span of some twenty pixels, over which it barely turns. The tip of a leaf 60 pixels across is measured over 4 pixels, and turns sharply over them. And the same drawing traced from a small photo or a large one gets the same corners, because every measure grows with the shape.
The two tests together come from the Draw tool, which finds corners in a hand-drawn line the same way, with its windows fixed in pixels rather than scaled to a shape. A wiggle turns sharply over a short stretch but not over a longer one, while a real corner turns over both, so asking for both separates them.
The metaphor
Corners borrow the paper cutter's knife. Along a curve the knife sweeps; at a corner it stops, comes out, and goes in again from the new direction, because a blade dragged around a corner tears the paper. The cutter decides where the corners are before cutting, and the tracer decides before fitting.
Corner span borrows the surveyor's ruler, and here the metaphor meets a famous puzzle. Lewis Fry Richardson noticed that the measured length of a border or a coastline depends on the length of the ruler used to measure it: the shorter the ruler, the more bays and headlands it finds. Benoit Mandelbrot made that the starting point of “How Long Is the Coast of Britain?” in 1967. Whether a bump is a corner depends on the ruler in exactly the same way, and Corner span is the ruler.
The metaphor breaks where the world is ambiguous. A photographed corner is often slightly rounded, and a photographed curve sometimes has a kink in it. The tracer has to call each one by its geometry alone. A person with a knife knows what the object is, and decides from that.
A history
In art
Drawing teachers have long taught students to find a form's big angles before its curves: to block it in with a few straight lines, see where they meet, and only then round them off. The habit has deep roots in academic training, which was built on patient copying. The drawing course Charles Bargue made with Jean-Léon Gérôme, published by Goupil between 1868 and 1873, took students from plaster casts to master drawings to the living model, plate by plate; Vincent van Gogh copied the whole course more than once, and Picasso worked from its plates as a student.
In 1954 the psychologist Fred Attneave argued that the information in an outline is concentrated where it bends most sharply. To show it he drew a sleeping cat with only 38 points, chosen at the places of greatest curvature and joined with straight lines, and the cat was still unmistakable. A notan lives on the same economy: get the corners right and the eye forgives a great deal in between.
In printing
In type, corners are not a detail but part of a letter's character: a sharp inside corner and a softly rounded one give two different voices. That is why Ikarus, the type digitizing system Peter Karow began at URW in 1972, asked its operators to classify each point before any curve was fitted, as a beginning, a corner, a tangent or a curve point. Font editors ever since have kept the same distinction between a smooth point, where the line's direction carries on, and a corner, where it may change. When you look at a traced shape with Points, you are looking at that distinction.
In technology
Finding corners on a digital outline became a problem as soon as outlines were digital. In 1961 Herbert Freeman proposed recording an outline as a chain of steps in a few fixed directions, the chain code; seen that way, a raw outline is nothing but corners. In 1973 Azriel Rosenfeld and E. Johnston published “Angle Detection on Digital Curves”, which measured the angle at each point from the outline's points some number of steps away on either side, and kept the points where the angle was sharpest nearby. Its weak spot, as later work pointed out, is choosing that number: too few steps and every jag is a corner, too many and real corners are missed. Much of the later work on corners, including tests at several scales at once, answers that question, and Corner span is this app's answer: the distance is not a number of pixels but a share of each shape.
Potrace has a single corner setting for a whole image, where 0 gives a polygon of straight lines and larger values smooth more corners away. Finding corners in a photograph, rather than on an outline, is a separate field: the widely used Harris detector of 1988 looks for points in an image where the brightness changes in two directions at once, which is a different question from where a traced line turns.
In professional software
Vector programs share one distinction between anchor points: a smooth point, where the path runs straight on through, and a corner point, where it may change direction. Tracers sort the points for you, and each gives you a control to tip the balance.
- Adobe Illustrator. ‘Corners’, under ‘Advanced’ in the ‘Image Trace’ panel, sets how readily a sharp bend becomes a corner point: higher values give more corners. ‘Snap Curves To Lines’ replaces slightly curved lines with straight ones, much as Studio Notan straightens runs that are nearly straight. Afterwards, the Anchor Point tool, ⇧C (Shift+C), makes a smooth point a corner with a click, or pulls handles out of a corner with a drag.
- Inkscape. ‘Smooth corners’ in ‘Path › Trace Bitmap’ rounds sharp corners, with a value that says how much. After tracing, select nodes with the Node tool,
N, and press ⇧C to make them corners or ⇧S (Shift+S) to make them smooth. - CorelDRAW. PowerTRACE’s ‘Corner smoothness’ slider works with ‘Smoothing’: lower values keep corners, higher values round them.
- Autodesk AutoCAD. Drafters keep corners by building outlines from lines and arcs, which meet at sharp vertices unless rounded with
FILLET. Turning a polyline into a curve with the ‘Spline’ option ofPEDITsmooths every vertex away, and ‘Decurve’ brings the corners back. - Autodesk Fusion (formerly Fusion 360). Where a spline meets a line in a sketch, the join is a corner unless you add a ‘Tangent’ constraint, which makes the two run on smoothly.
What carries over. Find the corners first and smooth between them: a path whose corners are right needs far fewer points everywhere else. Watch which way each control runs. In Illustrator a higher ‘Corners’ value gives more corners, as a lower Corner angle does here, while the corner settings in Inkscape and CorelDRAW round more corners away as they rise.
Try this
- With “Preview” on “Outlines”, trace a star or a maple leaf and lower “Corner angle” until every point has its square. Then raise it and watch the squares go out, the sharpest last.
- Raise “Corner span” to 10% on a jagged outline: the small corners vanish and only the shape's big turns remain.
- Find a shape whose outline looks lumpy. Raise “Corner span” a little: fewer, better-placed corners let Smoothness even out the runs between them.
Going further
See Smoothness, Curves and Path editing.
- Benoit Mandelbrot, The Fractal Geometry of Nature
- Charles Bargue and Jean-Léon Gérôme, Drawing Course