ChangeBgPhotoA PictureEditor.com tool

Hair, fur and glasses

Hair is where a background change is won or lost, and it is where most people give up. What follows is what the arithmetic can actually recover, what it cannot, and how to tell which of the two you are looking at before you spend twenty minutes on it.

What an edge is, before anything tries to find one

Start with the thing that makes this hard. A photograph is a grid of measurements, and a strand of hair is thinner than one cell of that grid. The camera does not record a strand against a wall; it records one number per cell, and where a strand crosses a cell that number is a weighted average of hair and wall. Fifty cells across the top of a head might be forty per cent hair and sixty per cent wall, every one of them slightly different.

So the job is not to find a line. It is to work out, for each of those cells, what the proportion was — which is possible when hair and wall are far enough apart in colour for the average to tell you something, and impossible when they are not. That single sentence explains every result you will get from this page, good and bad.

The first photograph: a head against a plain wall

This is the case document photographs are, and it is the case that works. The wall is one or two tones, the hair is much darker or much lighter, and every boundary cell sits somewhere measurable between the two. The page fits a colour model to the frame’s own border, grows a background region inward from it, and refines the result against the photograph’s detail, which recovers a genuinely soft edge — loose strands included — without any intervention.

What to check before saving: the shoulders, where a dark jacket against a dark wall is the weak point rather than the hair, and the gap under the chin, where a collar and a shadow often read as one object. Both are two strokes of the erase brush.

When the wall is the same tone as the hair

The confidence reading under the controls drops, and it is telling you something true: there is no measurable difference to work from at that part of the outline. Raising the tolerance will not help — it will start eating the subject. Lower the edge resistance so the growth follows what contrast there is, then paint the rest. Fifteen seconds with the keep brush beats five minutes with the sliders.

The second photograph: a dog on a lawn

Fur is hair with more of it, and grass is a wall with structure. Two things change. The colour model has more work to do, because a lawn in sunlight spans a much wider range than a painted wall — which is what the three sampled tones are for, and why the page samples the border ring rather than a single point.

The second change is that grass has edges of its own, and the growth is edge-aware. Turn the edge resistance up and the selection stops respecting the fur because it is too busy respecting the blades of grass; turn it down and the selection wanders into the animal. The setting that works on a lawn is lower than the one that works on a wall, which is the opposite of what most people try first.

Then unmix. Grass is strongly coloured and an unmixed outline against any pale ground will carry it visibly. If a green edge survives the unmixing, the boundary is sitting a pixel or two outside the animal and a light pass of erase along the outline will clear it.

The third photograph: spectacles, and everything else you can see through

A lens is not an edge problem. It is a pixel that has two answers: the thing behind the lens, bent by it, and the reflection sitting on the front of it. The whole model here — one opacity per pixel, mixing a subject with a ground — cannot express two answers, so it gives the one it can: the lens is subject, fully opaque, and whatever was visible through it is replaced along with the rest of the ground.

In practice this is fine on a document photograph and wrong on a product shot. The area of a spectacle lens in a passport photograph is small, the ground behind it was about to become flat white, and the result is indistinguishable from a photograph taken against white. A wine glass, a bottle, a car window or a veil is a different matter: those are mostly background by area, and treating them as solid produces an object that does not look like the object.

The page says so in the panel rather than letting you discover it, and there is no setting that changes it. It is a limit of what a single opacity per pixel can describe.

Questions this raises

Why does hair come out as a solid block instead of strands?
Because the strands are thinner than a pixel and the photograph never contained them as separate things. A single pixel over the edge of a head of hair is part hair and part wall, and the only honest description of it is a partial opacity. When the wall and the hair are far apart in tone the page can work out that proportion and the result looks like hair. When they are close — dark hair against a dark room — there is no measurable difference to work from, and it falls back to a boundary.
My glasses came out with a hard rim and the lenses are opaque. Is that a bug?
No. The arithmetic gives every pixel one opacity, and the correct answer for a lens is two colours at once: what is behind it, distorted, plus a reflection on its surface. Nothing here can express that, so a lens is treated as part of the subject and the ground behind it is simply gone. On a document photograph nobody notices, because the ground behind a small lens was about to become flat white anyway.
The dog's fur has a green edge after the lawn was replaced.
That is the boundary pixels carrying the lawn's colour, and it is exactly what the unmixing control removes. If it is still there with unmixing on, the selection is a little too generous: some of those pixels are grass rather than edge. Paint a pass of erase just inside the outline and it will clear.
How much can I fix with the brushes?
More than you would expect on shape, and nothing on detail. A brush moves the boundary, so it will rescue a selection that ate a shoulder or kept a chair leg, quickly and precisely. It cannot invent strands that the photograph does not distinguish from the wall. If the result is the wrong shape, paint. If it is the right shape but flat, the photograph is the limit.

How to tell when to stop

There is a point in every difficult selection where more work stops helping, and recognising it is worth more than any technique. The test is simple: look at the result at the size it will actually be seen. A passport photograph is printed at thirty-five millimetres wide, and an outline that is half a pixel wrong at full resolution is not present at all at that size.

If it survives that test, stop. If it does not, ask whether the problem is shape or detail. Shape is fixable, with brushes, in under a minute. Detail — strands the photograph never distinguished from the wall — is not fixable here or anywhere else, and the right response is a different photograph rather than a longer session.

Back to the working surface

Cutout and composite run here. No upload.