Studio Notan LEARNING HUB
Launch Studio
Trace a photo

Threshold, Auto and Invert

Where front stops and back begins.

The threshold is the moment a photograph stops being a photograph. Every pixel on one side of a single number becomes front, every pixel on the other side becomes back, and the photo's hundreds of tones collapse into the two of a notan. “Auto” finds a good number for you; “Invert” swaps the sides.

What it does

The control changes its name with “Separate by”:

  • “Threshold”, when you separate by brightness, runs from 0 to 255. Pixels at or below it are front; pixels above it are back. Dark is front, so raising the threshold pulls lighter tones into the front.
  • “Balance”, when you separate by color, cuts the color score. Pixels scoring above it are front. The score compares each pixel's distance from the nearest front color with its distance from the nearest back color, measured in CIELAB, a color space laid out so that equal distances look roughly equally different. Your picked colors themselves score near 255 (front) and near 0 (back), and a pixel equally near both sides scores 128. Raising Balance means a pixel has to be nearer a front color to count.

The cut is drawn as a line standing across the histogram. With “Preview” on “Two-tone” you see the split it makes, front in your Front color and back in your Background color: the notan the trace will make. “Outlines” shows the traced shapes themselves.

“Auto” is on by default. It sets the cut by Otsu's method, from the histogram after levels and blur, and moves the slider and the line to show where. Drag the line, press the histogram, drag the slider or type a value, and Auto turns off; press “Auto” again to hand the choice back.

Otsu's method tries every possible cut, from 0 to 255. For each one it divides the pixels into the group below and the group above, and works out each group's share of the pixels and its average level. It scores the cut by multiplying the two shares together, and that by the square of the difference between the two averages. The cut with the highest score wins: the one that makes the two groups most different from each other, which is the same as making each group most alike within itself.

“Invert” swaps front and back without moving the cut. In brightness mode the lighter side becomes front; in color mode, pixels nearer the back colors do. With Auto on, the cut is the same one Otsu found; only the sides change.

Around a skewed photo there are pixels that are not photo. They are always back, whatever the threshold and whether or not Invert is on.

Why it works this way

A paper cut has two states, cut or not. So the trace makes exactly one decision per pixel, and everything around the threshold exists to make that decision clean: Levels and Blur prepare the tones before it, and Detail tidies the result after it.

Front is dark by default because most things worth tracing are darker than their ground: ink on paper, a figure against the sky, a dark paper cut-out on a pale table. Color mode keeps the same habit: the first time you use it, it suggests the photo's two main colors with the darker as front.

Auto is on by default because a fixed number would suit one photo in a hundred. Otsu's method is fast, needs no tuning and gives a sensible cut on most photos with two clear humps. It struggles in known ways: a small subject on a large, even background, whose little hump the method treats as a detail beside the big one; three humps, such as a dark figure, a gray table and a white wall, where it must throw the middle hump to one side or the other; heavy noise; and light that changes across the picture. That is when you take the slider yourself.

Invert exists because either side of a picture can be the one you want to cut. Tracing the sky around a tree, rather than the tree, is one click rather than a recoloring.

The metaphor

The threshold borrows the graphic-arts camera and its lith film. To copy a drawing or a page of type for printing, a printer photographed it on film of such steep contrast that it records almost nothing below a certain amount of light and goes fully black above it. Every gray went one way or the other, and every point of the negative came out clear or black. Printers called the result line work, and it is the ancestor of the two-tone preview.

It also borrows the stencil cutter's yes or no. Each part of a stencil is cut or left; there is no half-cut.

The metaphor holds for the single, hard decision. It breaks in two places. Lith film's cut depends on exposure time and on the developer, and it wanders; this one is a number, and it never moves unless you move it. And the printers' real answer to photographs was not a threshold at all but the halftone screen, which breaks a picture into dots too small to see, each dot a tiny threshold of its own, so that the eye rebuilds the grays. The notan refuses that trick on purpose. It asks you to choose one line and make the picture live with it.

A history

In art

Pure two-tone pictures are older than photography. Cut-paper profiles, black card against a pale ground, became popular in the mid-18th century as a cheap alternative to painted miniatures. They took the name silhouette from Étienne de Silhouette, a French finance minister of 1759 whose austerity made his name a byword for anything done cheaply. A skilled cutter could make a likeness in minutes, by eye.

In the 1890s Félix Vallotton made woodcuts of broad black and white masses, dropping the hatching that printmakers had used to imitate gray; his Intimités series of 1898 shows how much tension a single dividing line can hold. In our own century Kara Walker has turned the cut-paper silhouette into large, confronting scenes about race and history. And the notan exercise in its plainest form, two values only, is a threshold made by hand: every area of the subject goes dark or light, and the design lives or dies by where the line falls.

In printing

“Invert” is the oldest trick in photography. John Herschel, who coined the word photography in 1839, was also the first to apply the words negative and positive to it, and William Henry Fox Talbot's calotype, patented in 1841, made the negative the master from which any number of positives could be printed. The graphic-arts trade built on both: line negatives shot on high-contrast film, printed to positives, and turned over again as the job required.

By combining several such exposures, each cut at a different level, darkroom workers made posterized prints with three or four flat tones: several thresholds stacked, where the notan uses one.

In technology

Deciding for each pixel whether it is ink or paper, binarization, is one of the oldest jobs in image processing; fax, document scanning and text recognition often begin with it. In 1979 Nobuyuki Otsu published “A Threshold Selection Method from Gray-Level Histograms” in the IEEE Transactions on Systems, Man, and Cybernetics. Its appeal was that it needs nothing but the histogram and no tuning at all, and it became one of the most cited papers in the field. Its criterion turns out to be a one-dimensional cousin of Fisher's discriminant analysis, and equivalent to the best possible split of the histogram into two clusters.

Its weaknesses are the ones described above. Local, or adaptive, methods answer them by choosing a different threshold for each neighborhood of the picture. This app keeps one threshold for the whole photo on purpose, because a notan is one decision made everywhere at once.

In professional software

Every tracing program starts with this decision, and most call it a threshold: one level that splits a gray image into black and white. They differ in where the control lives, in which side becomes the shape, and in whether they suggest a level for you.

  • Adobe Photoshop. ‘Image › Adjustments › Threshold’ shows a histogram with one ‘Threshold Level’ slider: pixels lighter than it turn white, darker ones black. Made as an adjustment layer it stays editable, so you can try several levels without harming the photo, and ‘Image › Adjustments › Invert’, ⌘I (Ctrl+I), swaps black and white.
  • Adobe Illustrator. In the ‘Image Trace’ panel, from ‘Window › Image Trace’, set ‘Mode’ to ‘Black and White’ and a ‘Threshold’ slider appears: darker pixels are traced as black, lighter ones as white. Under ‘Advanced’, ‘Ignore White’ leaves out the white areas, so only the dark shapes remain.
  • Inkscape. ‘Path › Trace Bitmap’, in its ‘Brightness cutoff’ mode, traces the areas darker than a ‘Threshold’ that runs from 0 to 1 rather than from 0 to 255. Its ‘Invert image’ checkbox does the work of Studio Notan’s Invert.
  • Autodesk AutoCAD. In the Raster Design toolset, the ‘Threshold’ tab of the ‘Histogram’ dialog turns a grayscale scan into black and white: grays to the left of the slider become black, grays to the right become white.
  • Silhouette Studio. The Trace panel has a ‘Threshold’ slider, and shades in yellow the areas it will trace.
  • LightBurn. ‘Tools › Trace Image’, ⌥T (Alt+T), traces the pixels whose brightness falls between two sliders, ‘Cutoff’ and ‘Threshold’: a band of tones rather than one side of a single line.

What carries over. Judge the cut on a two-tone view, never on the photo, and nudge the level either way to test how steady the edges are. Watch two differences. Photoshop and Illustrator open at 128 and leave the choice to you, where Studio Notan starts from Auto. And a tracer that keeps both sides, as Illustrator does until you tick ‘Ignore White’, turns the light areas into shapes as well, which a cutting machine would cut.

Try this

  • With “Preview” on “Two-tone”, press “Auto”, then drag the threshold ten levels either way. On a good photo the shapes barely change; on a difficult one they swell and shrink. That tells you how deep the valley is.
  • Trace a tree against the sky, then tick “Invert” and look again: the sky becomes the shape, and the tree becomes the hole.
  • In color mode, drag “Balance” from 128 toward 200 and watch the doubtful pixels, the ones like neither color, fall to the back.

Going further

See Histogram, Front and back colors and Detail.

  • Richard Benson, The Printed Picture
  • Rafael C. Gonzalez and Richard E. Woods, Digital Image Processing

Every chapter is about something you can do in the studio, free, in the browser.

Try it in the studio