Editing an ImageLesson 27 of 78

Module 3 · Selections, cut-outs and edges

Three equations, seven unknowns: why hair is hard

In this lesson

  • 9 min read
  • 8 reading sections
  • Knowledge check
  • Lesson 7 of 9 in this chapter

This chapter’s goalChoose and execute the right extraction method for a given edge (path, painted mask, colour range, luminosity, model or blend-mode composite) decontaminate the result so it carries no trace of its old background, and run a batch of cut-outs to a consistent standard with a sampling check that catches the failures.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available
A green fringe on hair: three things that fail, and what addresses the causeDoes not workContracting by a pixel: strands are two orthree pixels wide, so you delete them and getthe helmetFeathering: spreads the contaminated pixelsacross a wider bandRaising the mask contrast: turns partialpixels fully on or off and removes thesoftness that made the edge believableWorksDecontaminate Colours: rewrites each partialpixel’s colour from nearby known foregroundand keeps its alphaIn GIMP: a layer clipped to the cut-out, setto Colour mode, painted along the fringe at 30to 50 per centAt capture: a neutral grey wall, subject twometres clear of it, lit separately, so thereis little spill to removeThe alpha is correct. The colour underneath it is wrong, because the recorded value of a partial pixelis a mixture that includes the old background. Only recomputing that colour treats the cause;everything on the left treats the symptom and costs you the hair.
The alpha is correct. The colour underneath it is wrong, because the recorded value of a partial pixel is a mixture that includes the old background. Only recomputing that colour treats the cause; everything on the left treats the symptom and costs you the hair.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 9Free · no account needed
Lesson steps

The compositing equation

Every pixel in a photograph where subject meets background obeys one relationship:

Text
I = α·F + (1 − α)·B

I is what the camera recorded. F is the foreground’s true colour at that pixel, B is the background’s true colour, and α is what fraction of the pixel the foreground covers.

That is three equations, one per colour channel, and seven unknowns: three for F, three for B, and α. The system is underdetermined. There is no correct answer derivable from the pixel alone; there are infinitely many combinations of foreground, background and coverage that produce the same recorded value.

This is not a software limitation. It is why extracting hair is hard, why every tool needs extra information from you, and why the answer is always an estimate.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Design, before Any Software exam.

Stuck on something?Ask Neema, your AI tutor

How to cite: Addaly (2026) ‘Three equations, seven unknowns: why hair is hard’, in Editing an Image. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/image-editing/matting-fringes-and-colour-spill (Accessed: 29 November 2026).