In Color mode you show the app what front looks like and what back looks like, by picking colors from the photo. Every pixel then goes to whichever it is nearer. Nearness is measured the way the eye measures it, in the CIELAB color space, rather than in a screen's red, green and blue.
What it does
Two rows, Front and Back, hold one to three color swatches each.
- Click a swatch to select it. The label below names it, for example “Front color #202020”, and the Hue (0–360), Saturation (0–100) and Brightness (0–100) sliders adjust it. Each slider's track is painted with what moving it would do.
- The pipette beside a swatch (“Pick this front color from the photo”) borrows the canvas: the pill says “Tap the photo to pick a color”. A tap takes the average of a 5 × 5 patch of the photo, so one noisy pixel doesn't decide, and it works through a skew. A tap off the photo picks nothing. Cancel or Escape leaves without picking.
- + adds another color to that side, up to three, and you pick it straight away. × removes one; it appears only when a side has more than one.
The first time you switch to Color for a photo, the app suggests a starting pair: it takes a sample of about 8,000 pixels, splits them into two groups by nearness in CIELAB, and offers each group's average color, the darker as front. Once you have picked colors, they are kept, and Reset keeps them too.
Ignore brightness (shadows stay front) leaves lightness out of the comparison, so only the color itself counts.
The score is 128 + k × (distance to the nearest back color − distance to the nearest front color), kept between 0 and 255. The factor k is 127 divided by the smallest distance between any front color and any back color. So a pixel exactly between the two sides scores 128, and with one color on each side, the front color itself scores 255 and the back color 0. Pixels above Balance are front; Auto chooses Balance for you, and Invert swaps the sides.
Why it works this way
A screen's red, green and blue are a recipe for making light, not a map of how colors look. Equal steps in RGB are not equal to the eye: a small change among dark blues can be glaring while the same change among bright greens goes unnoticed. CIELAB was designed so that equal distances look roughly equally different. It has three axes: L* for lightness, from 0 for black to 100 for white; a* from green to red; and b* from blue to yellow. Pure black and pure white are exactly 100 apart.
The distance used here is the straight line between two colors in that space, called ΔE (delta E). The app converts each pixel from sRGB to linear light, then to the CIE's XYZ, then to CIELAB, under daylight white.
More than one color per side is for subjects that are not one color: a black-and-white cat on grass needs two front colors, black and white, against the green. Each pixel is judged by its nearest color on each side.
Ignore brightness is for shadows. A shadow across a red coat is a darker red, and with lightness counted it may drift toward a dark back color. Compare only a* and b* and the shadow is still red. The flip side: for a photo whose front and back differ only in lightness, black on white, Ignore brightness leaves almost nothing to tell them apart. Leave it off there, or use Brightness.
The suggested pair puts the darker color as front so that switching modes doesn't turn the notan inside out: Brightness mode traces the dark side by default, and so does the suggestion.
The metaphor
The swatch book held against a sample. Dyers, printers and paint mixers match color by putting a known chip beside the thing and judging the difference. Each swatch here is a chip, and the score is a judgment, made for every pixel at once, of which chip it is closer to.
The metaphor breaks on context. The eye judges a color by its neighbors; the pipette reads numbers. A patch of white paper in shadow may look white to you and measure as a bluish gray, and the app will side with the measurement. If a pick surprises you, look at its hex code under the sliders: it is telling you what the photo really holds.
A history
In art
In 1824 the chemist Michel Eugène Chevreul took charge of the dyes at the Gobelins tapestry works in Paris. Weavers complained that the black wool looked dull. Chevreul tested the dye and found nothing wrong with it; the fault lay in the colors woven next to it, which changed how the eye saw it. His book on the law of simultaneous contrast (1839) set out how every color is shifted by its neighbors, and it was widely read by painters. It is the reason a pipette and an eye can disagree.
In printing
In 1963 Lawrence Herbert introduced the Pantone Matching System: numbered colors, each with a recipe from a small set of base inks, so that a designer in one city and a printer in another could mean exactly the same color by a number. Matching on press later came to be checked with instruments and judged in ΔE: a print passes if it lies within so many units of the target.
In technology
The International Commission on Illumination (CIE) defined CIELAB in 1976, with the straight-line distance as its color difference, known today as CIE76. It turned out less even than hoped, especially among vivid colors, and was refined in 1994 and again in 2000 into CIEDE2000. This app uses the original: simple, fast, and good enough to decide which of two colors is nearer.
The suggestion uses k-means with two groups: guess two centers, give each sample to the nearer, move each center to the average of its group, repeat. Stuart Lloyd devised it at Bell Labs in 1957 for a problem in signal coding, though it was not published until 1982; James MacQueen gave it the name k-means in 1967. Here it starts from the darkest and lightest samples and runs twelve rounds.
In professional software
Choosing pixels by their nearness to sampled colors is called color-range selection, or keying in video. The idea that transfers is tolerance: you sample a color, then decide how far from it a pixel may be and still count.
- Adobe Photoshop. ‘Select › Color Range’ samples with an eyedropper, adds colors with its plus eyedropper and takes them away with its minus one, while ‘Fuzziness’ sets how far the choice reaches. Its preview shows the selection as a gray image, white where selected, much like the Adjusted view here. The Magic Wand (
W) works by a ‘Tolerance’ instead; untick ‘Contiguous’ to take every matching pixel, not only the connected ones. - Adobe Illustrator. In Image Trace’s Color mode, the ‘Document Library’ palette traces with only the colors of a color group you choose, a way of deciding in advance which colors the trace may use.
- Adobe Premiere Pro. The Ultra Key effect removes a color you pick with its eyedropper, the video form of a back color, and its ‘Output’ setting can show the result as a black-and-white matte.
- GIMP. The Select by Color tool, ⇧O (Shift+O), picks every pixel near a color you click, with a ‘Threshold’ that does the work of Fuzziness.
What carries over. Sample from the middle of an area, not its edge, and take several samples for a subject in several colors. The difference: those tools make a selection or a matte, which you then use to mask or fill. Here the colors you pick make a split, judged against back colors as well as front, and measured in CIELAB, closer to how the eye sees.
Try this
- Photograph a red coat or a red cup in a shadowy corner. Pick the red as front and the wall as back, then tick Ignore brightness and watch the shadow rejoin the front in Two-tone.
- Add a second front color for a subject in two colors, and compare Two-tone before and after.
- Pick a color, then nudge its Hue slider and watch the Adjusted preview brighten and darken as the photo's pixels fall nearer or further.
Going further
See Separate by, Threshold, Auto and Invert and Adjusting the photo on the canvas. M. E. Chevreul, The Principles of Harmony and Contrast of Colours. Mark D. Fairchild, Color Appearance Models.