How to cut out hair, fur and glass from a background

Why hair, fur, glass and thin straps are where background removers fail, and how to check and fix those edges for free in your browser.

Updated . How guides are checked

Primary sources checked

Use Best edges, start from the largest photo you have, and check the result on both a white and a black background. Fix halos with Despill and Smooth, paint missed strands back with Restore, and treat glass separately, because a cutout can only make it opaque or remove it, not keep what shows through.

Every background remover gets a plain product on a plain backdrop right. The differences show up in the same few places: hair against a background of a similar colour, fur, whiskers, thin straps and cables, and anything made of glass. This guide explains why those edges are hard and how to check and fix them in Remove Image Background.

Why these edges fail

A cutout is two things: the photo’s colours and a transparency value, called alpha, for every pixel. Where the subject is solid, alpha is 1. Where the background shows, it is 0. Along hair and fur it is somewhere in between, because a single pixel holds part of a strand and part of the wall behind it.

Background models do not look at the photo at full size. FileGizmo’s Best edges model looks at it at 1024 pixels on the long side when it runs on your graphics card, and at 512 pixels on the processor. A strand that is two pixels wide in a 4000 pixel photo is less than one pixel wide in what the model sees, so it becomes a faint, soft band rather than a line.

The mask is then brought up to the photo’s size. Stretching it would blur the edge and put it up to half a mask pixel in the wrong place. FileGizmo instead uses a guided filter, which lines the enlarged edge up with the edges in the photo itself. On our test scenes drawn larger than the model’s size, that lowered the average error in the band around the edge from 0.117 to 0.105.

Glass is harder still. What you see through a glass is the background, bent and reflected. A cutout can only say how transparent each pixel is; it cannot move the background the glass should now show. That is why glass either comes out opaque, carrying the old background inside it, or disappears.

Get the best first result

  1. Choose Best edges. People only is faster, but it is trained for portraits and does not do fur or objects. Flat colour is for logos and signatures on plain backgrounds, not for hair.
  2. Use the largest, sharpest photo you have. A photo that was already shrunk by a messaging app has lost the strands before the model sees them.
  3. Prefer contrast. Dark hair on a light wall, or light hair on a dark one, separates far better than brown hair on a beige wall. If you are taking the photo for this purpose, choose the background with that in mind.

Check the edges properly

A cutout shown on a checkerboard looks cleaner than it is. On the Background tab, put it on white, then on a dark colour, and zoom in on the hair with the wheel or two fingers:

  • A light or coloured rim on dark is old background left in the edge pixels.
  • A dark rim on white is the same problem with a dark original background.
  • Hair that stops in a hard line is where the mask was too sure.
  • Gaps in a strap or a cable are thin parts the model did not see.

Hold for original and the compare slider show the photo underneath, which makes it easy to see what was lost.

Fix what you find

Open the Edges tab.

  • Despill removes the old background colour from the edge. Raise it until the rim disappears on the dark background, and stop before the hair turns grey.
  • Smooth evens out a jagged edge, and Feather softens a hard one by a few pixels. Use them lightly on hair, where both also soften real detail.
  • Restore with a soft brush paints missed strands back. Set Hardness low for hair and high for straps. Smart keeps the brush from spilling into the background by following the photo’s own edges.
  • Erase takes out background caught between strands.
  • Keep object and Remove object take a whole object with one click, for a strap, a bag or a hand the model left out or kept by mistake. The first use downloads the selection model once.

Undo and redo work for every step, with Ctrl and Z on a keyboard.

Glass, bottles and see-through products

For a glass product, decide what the finished picture needs:

  • On white or a light colour, the most natural result often comes from not cutting the glass out at all: shoot it on the colour you want, or place the whole cutout, glass included, on a backdrop close to the original.
  • On a different backdrop, use Restore to keep the glass fully, then lower the edge contrast with Feather, so the old background inside it reads as the glass’s own tint.
  • Labels and caps are solid and cut out cleanly. It is only the see-through parts that need a decision.

Our own measurements show where this stands. On a synthetic glass scene with a known answer, Best edges on the graphics card overlapped the true shape by 0.94 at the model’s own size but only 0.66 when the scene was drawn four times larger, which is the kind of variation to expect on real glass. The measurements page lists every scene.

Save it in a format that keeps the edge

Soft edges are only kept by formats with transparency. Save as PNG or WebP on the Size tab. A JPG has no transparency, so it fills the soft edge with the background colour you chose; that is fine when the colour is final, and the reason to keep a PNG copy when it is not.

The photo stays in your browser throughout. Best edges and the selection model are downloaded once and kept on your device.

Tools for this guide

Frequently asked questions

Why does hair come out blocky or with a halo?

A background model predicts a mask at a fixed size, 1024 or 512 pixels, and the mask is then brought up to the photo's size. Strands thinner than one mask pixel blur into a soft band, and the old background colour stays mixed into the edge pixels.

What is Despill?

Despill takes the colour of the old background back out of the edge pixels, so a person shot against a green or blue wall does not keep a coloured rim on a new background. FileGizmo also estimates the subject's own edge colour automatically before you touch it.

Can a background remover keep a glass see-through?

Not fully. A cutout is a picture plus a transparency value per pixel, so it can make glass partly transparent but cannot recreate the refraction and reflections of the new background. For product shots, keep the glass on a plain background close to the final one.

Does a bigger photo give better hair?

Usually. The model sees the photo at a fixed size either way, but FileGizmo follows the photo's own edges when it brings the mask up to full size, and a sharper source gives it more to follow.

Primary references