Cutout, then the edge check

How to remove the background from a photo of yourself for a YouTube thumbnail

Updated Tested November 27, 2026Three CC0 portraitsRuns in your browser

Scissors cut a portrait silhouette from its photo onto a checkerboard, checked on black and white swatches.

Short answer

Look at the hair before you trust a cutout. The free Koldflux person background remover turns your photo into a transparent PNG in your browser, so nothing is uploaded; put that PNG on black and on white and check the edge. On a plain wall, 38.2% of our test portrait came out solid and 16.4% soft. On a street photo with a dark, busy background, a box we drew over the hair kept 4.4% of its pixels; a brightened copy of the same photo kept 74.0%, though faded. The script below makes both previews and prints the numbers.

Remove the background from a photo of a person (free, runs in your browser)

Key takeaways

  • The cutout itself takes seconds. The tool reported 3.0 to 3.4 seconds on 1600 px photos (tool-run-raw.txt), and the PNG keeps the photo's pixel size (1600 × 1066 in, 1600 × 1066 out).
  • A clean wall behind you is the easy case. On our wall portrait the corners were fully transparent (alpha 0) and the curls came through; 38.2% of the picture was solid, 45.4% transparent and 16.4% soft.
  • Dark hair on a dark or busy background is where the edge needs a look. In a box we drew over the curls in the street photo, 4.4% of the pixels were kept at first, and 6.0% in a box over the ear in the dark photo. This is one run on each photo, with a box on two of the three photos, not a rate.
  • A brightened copy brought most of that back, though faded: the street hair box went from 4.4% to 74.0%, and the dark ear box from 6.0% to 79.9%. On the wall portrait, which was already fine, brightening changed the transparent share from 45.4% to 46.2%. The top of the head in the dark photo was not recovered; we looked at it and did not measure it.
  • YouTube's help page recommends 3840 × 2160 px at 16:9, JPG or PNG, with a minimum width of 640 px for videos and up to 50 MB for a video thumbnail. The tool does not place you on a thumbnail; the script's `thumb` command does a plain one-colour frame.

How do you get a transparent PNG of yourself?

Five steps. After each one there is a line saying what you should see, so you know whether to go on.

  • Open the Koldflux person background remover (button above) and choose your photo. A portrait with you filling most of the frame works best. You should see your photo and a short wait.
  • Wait for the result. On our 1600 px photos the tool printed 3.0 to 3.4 seconds. You should see you on a grey checkerboard, which is how a browser shows transparency.
  • Download the PNG (transparent). The JPG button saves you on white, so it is not the one for a thumbnail. You should have a file with the same width and height as your photo.
  • Check the edge with the script below: it saves the cutout on black and on white. You should see hair and shoulders on both; pale fringes show on black and dark fringes show on white.
  • Place the PNG on your thumbnail in your editor, or make a plain frame with the script's thumb command. You should see you on the colour with no box around you.

Run in headless Chromium on November 27, 2026: three photos and three brightened copies, each downloaded as PNG and JPG (tool-run-raw.txt). The page says the model runs in your browser; network traffic was not inspected. The tool has no thumbnail or placement setting; it gives a cutout and nothing else.

The Koldflux person background remover with a cutout of a woman with curly hair on a checkerboard, a 1600 by 1066 px note and a Download PNG (transparent) button
The live tool on the wall portrait. The cookie panel is the site's own. Screenshot, November 27, 2026.

What should the edge look like on a good photo?

Start with the case that works, so you know what good looks like. Our wall portrait is a woman with curly hair in front of a pale wall (CC0, rescaled to 1600 px). The figure shows the photo, the cutout on black, on white and on a blue thumbnail frame.

The numbers from the script: corner alpha 0 0 0 0 (the corners are fully see-through), 45.4% of pixels transparent, 38.2% solid, 16.4% soft, where soft means partly transparent (alpha 1 to 254). Soft pixels are what hair and the outline are made of, so a share of 16.4% is expected on curls. It is not a quality score.

Look at the left curls on the blue frame: a thin pale rim stays where the pale wall met the hair. That is the thing to look for on your own file. If it is visible at the final thumbnail size, use a lighter frame colour or erase the rim in your editor. The tool page says the same about the edge: "The model decides at a coarse resolution, so the outline can be slightly soft." (Koldflux tool page, read November 27, 2026)

A woman with curly hair: the photo, the cutout on black, the cutout on white, and the cutout on a blue 16 by 9 frame, with a pale glow along the left curls
1 photo, 2 on black, 3 on white, 4 on a blue frame. The glow along the left curls is the pale wall that stayed in the soft edge.
The cutout of the woman on a flat blue 1280 by 720 frame, placed on the right
The script's thumb command at 1280 × 720, plain blue (1F3A93). Our placement, not the tool's.

How do you check the hair edge on your own cutout?

Save the script, then run check on your PNG. It prints the corner alpha, the transparent, solid and soft shares, and saves two previews: your cutout on black and on white. Open both at 100% zoom. Look at three places: the top of the head, the hair on both sides, and the shoulders.

If you want a number for one area, give it a box (X,Y,W,H in pixels from the top-left corner) over the hair. It prints the share of pixels in the box with alpha 128 or more. Draw the box by hand over the hair and the gaps between curls. A low share where you can see hair means the model dropped it.

Run on November 27, 2026 (python 3.10.18, Pillow 10.1.0, numpy 1.25.2). Controls with a known answer: a 300 × 300 clear picture with one solid 100 × 100 square printed solid 11.1%, soft 0.0% and 100.0% for a box on the square; a 100 × 100 picture at alpha 128 printed soft 100.0%; a JPG, which has no transparency, was refused with exit 2. Edge cases (missing file, empty file, a text file named .png, a box outside the picture, a bad gamma or size, a non-ASCII file name, a 3840 × 2160 frame) are in commands.log with their exit codes.

#!/usr/bin/env python3
"""Check and use a transparent cutout PNG. Needs Python 3 with Pillow and NumPy.

  python3 cutout_tools.py check  cutout.png [--box X,Y,W,H] [--prefix NAME]
  python3 cutout_tools.py lift   photo.jpg lifted.jpg [--gamma 0.45]
  python3 cutout_tools.py reapply original.jpg cutout_of_lifted.png result.png
  python3 cutout_tools.py thumb  cutout.png thumb.png [--size 1280x720] [--color 1F3A93]

check  prints corner alpha, how much is transparent, solid or soft, and saves NAME-on-black.png and NAME-on-white.png.
lift   brightens a copy (draft setting 0.45, not a rule) so a cutout tool can see dark hair.
reapply puts the mask of the cutout made from the lifted copy onto the original pixels (the output must be a .png).
All commands turn a phone photo upright using its rotation tag before they work. The output name must differ from the input name: a command stops with exit 2 instead of overwriting.
thumb  scales the cutout to the frame height, puts it at the right on a flat colour.
"""
import argparse
import os
import sys

try:
    import numpy as np
    from PIL import Image, ImageOps, UnidentifiedImageError
except ImportError:
    sys.exit("Needs Pillow and NumPy: python3 -m pip install pillow numpy")


def fail(msg):
    print("error: " + msg, file=sys.stderr)
    sys.exit(2)


def check_out(path, inputs, exts):
    for i in inputs:
        if os.path.exists(path) and os.path.samefile(path, i):
            fail("the output is the same file as the input (" + path + "): use a new name")
    if os.path.splitext(path)[1].lower() not in exts:
        fail("the output name must end in " + " or ".join(exts) + ": " + path)
    folder = os.path.dirname(path) or "."
    if not os.path.isdir(folder):
        fail("folder does not exist: " + folder)


def load(path, want_alpha=False):
    if not os.path.isfile(path):
        fail("file not found: " + path)
    if os.path.getsize(path) == 0:
        fail("file is empty: " + path)
    try:
        im = Image.open(path)
        im.load()
        im = ImageOps.exif_transpose(im)
    except (UnidentifiedImageError, OSError):
        fail("not an image Pillow can read: " + path)
    if want_alpha and im.mode == "P" and "transparency" in im.info:
        im = im.convert("RGBA")
    if want_alpha and "A" not in im.getbands():
        fail("no transparency in " + path + " (a JPG has none: use the PNG the tool gives you)")
    return im


def cmd_check(a):
    im = load(a.cutout, True).convert("RGBA")
    check_out(a.prefix + "-on-black.png", [a.cutout], (".png",))
    arr = np.array(im)
    al = arr[..., 3]
    h, w = al.shape
    total = h * w
    edge = (al > 0) & (al < 255)
    print("size: %d x %d" % (w, h))
    print("corner alpha (top-left, top-right, bottom-left, bottom-right): %d %d %d %d"
          % (al[0, 0], al[0, -1], al[-1, 0], al[-1, -1]))
    print("transparent (alpha 0): %.1f%%" % (100.0 * (al == 0).sum() / total))
    print("solid (alpha 255): %.1f%%" % (100.0 * (al == 255).sum() / total))
    print("soft (alpha 1-254): %.1f%% = %d pixels" % (100.0 * edge.sum() / total, edge.sum()))
    if a.box:
        try:
            x, y, bw, bh = [int(v) for v in a.box.split(",")]
        except ValueError:
            fail("--box needs four whole numbers: X,Y,W,H")
        if x < 0 or y < 0 or bw < 1 or bh < 1 or x + bw > w or y + bh > h:
            fail("--box leaves the picture (%d x %d px)" % (w, h))
        sub = al[y:y + bh, x:x + bw]
        print("box %s: %.1f%% of its pixels have alpha 128 or more" % (a.box, 100.0 * (sub >= 128).sum() / sub.size))
    for name, bg in (("black", (0, 0, 0, 255)), ("white", (255, 255, 255, 255))):
        out = Image.alpha_composite(Image.new("RGBA", im.size, bg), im).convert("RGB")
        out.save("%s-on-%s.png" % (a.prefix, name))
    print("saved %s-on-black.png and %s-on-white.png: open both at 100%% zoom and look at hair and shoulders" % (a.prefix, a.prefix))


def cmd_lift(a):
    if a.gamma <= 0 or a.gamma > 1:
        fail("--gamma must be above 0 and at most 1 (below 1 brightens)")
    check_out(a.out, [a.photo], (".jpg", ".jpeg", ".png"))
    im = load(a.photo).convert("RGB")
    arr = (np.array(im).astype(float) / 255.0) ** a.gamma
    Image.fromarray((arr * 255).round().astype("uint8")).save(a.out, quality=95)
    print("saved %s (gamma %.2f)" % (a.out, a.gamma))


def cmd_reapply(a):
    check_out(a.out, [a.original, a.cutout], (".png",))
    orig = load(a.original).convert("RGB")
    cut = load(a.cutout, True)
    if cut.size != orig.size:
        fail("sizes differ: original %dx%d, cutout %dx%d" % (orig.size + cut.size))
    out = orig.convert("RGBA")
    out.putalpha(cut.getchannel("A"))
    out.save(a.out)
    print("saved %s (original pixels, mask from %s)" % (a.out, a.cutout))


def cmd_thumb(a):
    try:
        tw, th = [int(v) for v in a.size.lower().split("x")]
        col = a.color.lstrip("#")
        rgb = tuple(int(col[i:i + 2], 16) for i in (0, 2, 4))
    except (ValueError, IndexError):
        fail("--size looks like 1280x720 and --color like 1F3A93")
    if tw < 1 or th < 1 or len(col) != 6:
        fail("--size looks like 1280x720 and --color like 1F3A93")
    if tw > 8192 or th > 8192:
        fail("--size is limited to 8192 pixels on each side")
    check_out(a.out, [a.cutout], (".png", ".jpg", ".jpeg"))
    im = load(a.cutout, True).convert("RGBA")
    box = im.getchannel("A").point(lambda v: 255 if v >= 128 else 0).getbbox()
    if box is None:
        fail("the cutout has no solid pixels")
    im = im.crop(box)
    scale = th / im.height
    im = im.resize((max(1, round(im.width * scale)), th), Image.LANCZOS)
    frame = Image.new("RGBA", (tw, th), rgb + (255,))
    if im.width <= tw:
        frame.alpha_composite(im, (tw - im.width, 0))
    else:
        print("note: the cutout is wider than the frame at full height: its left %d px are cut off" % (im.width - tw))
        frame.alpha_composite(im.crop((im.width - tw, 0, im.width, th)), (0, 0))
    frame.convert("RGB").save(a.out)
    print("saved %s at %dx%d" % (a.out, tw, th))


p = argparse.ArgumentParser(description="Check and use a transparent cutout PNG")
s = p.add_subparsers(dest="cmd", required=True)
c = s.add_parser("check"); c.add_argument("cutout"); c.add_argument("--box"); c.add_argument("--prefix", default="check"); c.set_defaults(f=cmd_check)
c = s.add_parser("lift"); c.add_argument("photo"); c.add_argument("out"); c.add_argument("--gamma", type=float, default=0.45); c.set_defaults(f=cmd_lift)
c = s.add_parser("reapply"); c.add_argument("original"); c.add_argument("cutout"); c.add_argument("out"); c.set_defaults(f=cmd_reapply)
c = s.add_parser("thumb"); c.add_argument("cutout"); c.add_argument("out"); c.add_argument("--size", default="1280x720"); c.add_argument("--color", default="1F3A93"); c.set_defaults(f=cmd_thumb)
args = p.parse_args()
args.f(args)
cutout_tools.py, the whole script. Needs Python 3 with Pillow and NumPy. It reads files and writes new ones next to them; it does not upload anything, and it stops instead of writing over a file when the output name equals the input name.
python3 cutout_tools.py check cutout.png
python3 cutout_tools.py check cutout.png --box 300,0,500,420
# open check-on-black.png and check-on-white.png at 100% zoom
# box line: share of the box with alpha 128 or more; low where you see hair = hair dropped
Replace the box numbers with a rectangle over your own hair. Save the preview files somewhere you can find them: check writes check-on-black.png and check-on-white.png.

What happens with dark hair on a dark background?

This is the case the edge check exists for. Two of our three portraits had dark hair against a background of a similar tone: a bearded man with curly hair in a busy street, and a freckled man against a near-black background (both CC0, rescaled to 1600 px on the long side).

In the street photo, a box we drew over the curls (300,0,500,420) kept 4.4% of its pixels at alpha 128 or more: the model kept the face and the beard and dropped most of the hair. In the dark photo, a box over the right ear (740,720,130,260) kept 6.0%. The top of the head was also soft and thin. The tool page lists this among its limits: "fine hair against a similar color" and "subjects whose color matches the background" (Koldflux tool page, read November 27, 2026).

Cutout check on three portraits
PhotoTransparentSolidSoftHair or ear box kept
Wall (pale wall behind dark hair)45.4%38.2%16.4%not drawn
Street (dark hair, busy background)61.0%21.0%17.9%4.4% (hair box)
Dark (near-black background)37.8%28.2%34.0%6.0% (ear box)

One run each.

Measured November 27, 2026 (test-results.txt). The boxes are rectangles we placed by hand and they also hold some background, so the percentages are for those boxes only. The wall portrait has no box because its hair needed none; the soft and solid shares are the same kind of count over the whole picture. The soft share cannot tell hair from leftover background: the street photo's fixed version had 43.8% soft, and inside the hair box none of its pixels were fully solid (next section).

Bearded man with curly hair: the photo, the cutout that drops most of the curls, the cutout of a brightened copy that keeps them, and that mask on the original pixels
Street photo. Top right: the first cutout on white, curls mostly gone. Bottom: the cutout of a brightened copy, then its mask on the original pixels.
A freckled man on a near-black background: the photo, its cutout on white with the right ear faint, and the mask of a brightened copy on the original pixels with the ear kept
Dark photo. The ear fades in the first cutout and is kept in the second; the top of the head stays thin in both.

How do you fix a dropped hair edge?

The model probably sees brightness and colour contrast (we did not test why). Dark hair on a dark background has little of either, so lift the shadows first. The script's lift command brightens a copy of the photo (gamma 0.45, a draft setting from our three photos, not a rule). Run the lifted copy through the same tool, then lay that cutout's mask over your original pixels with reapply, so you keep the true colours and only borrow the outline. The mask brings the curls back, but see-through and with a faint haze of background (figure below).

Results on November 27, 2026. Street hair box: 4.4% kept at first, 74.0% on the lifted copy (alpha 128 or more). In that box 3.0% of the pixels were fully solid at first and 0.0% after the fix, and 98.9% had some opacity, against 15.7% at first: the curls are back, but faded, and on the blue frame the street photo shows a faint pale haze near the right ear and above the head (figure). The transparent share of the whole picture fell from 61.0% to 38.9%. Judge it on your own background colour before you use it. Dark ear box: 6.0% and 79.9%. The control is the wall portrait, which was already good: lifted, it gave 46.2% transparent, 38.4% solid and 15.5% soft, against 45.4%, 38.2% and 16.4%, so brightening did not damage a clean result. reapply copied the mask exactly: the wall, street and dark files after reapply have the same shares as the lifted cutouts. reapply stops with exit 2 if the cutout and the photo differ in size (commands.log).

In the dark photo the top of the head was not recovered by the lift. If the check shows that after the fix, the clean options are a photo with a lighter background, or covering the head edge with a design element (a glow, a shape) in your editor.

python3 cutout_tools.py lift photo.jpg photo-lift.jpg
# cut photo-lift.jpg out with the Koldflux tool, save the PNG as photo-lift-cut.png
python3 cutout_tools.py reapply photo.jpg photo-lift-cut.png photo-fixed.png
python3 cutout_tools.py check photo-fixed.png --box 300,0,500,420
Four commands. The second line is you using the tool on the lifted copy. Replace 300,0,500,420 with a box over your own hair, or leave out --box. Every output needs a new name; reapply writes a .png.
The bearded man cut out on a blue frame twice: left, the first cutout with the curls missing; right, the fixed cutout with the curls back but see-through, blue showing through them, and a pale haze near the right ear
Street photo on the blue 1F3A93 frame. 1 First cutout. 2 Fixed cutout: the curls are back, faded, with some pale background left.

Where does this fit in a thumbnail?

YouTube Help (read November 27, 2026) recommends a thumbnail of 3840 × 2160 pixels at 16:9 for videos, in an image format such as JPG or PNG, with a minimum width of 640 pixels. The size limit is 50 MB for a video thumbnail on desktop and on mobile (on mobile, 10 MB for podcast thumbnails). Our thumb command makes a one-colour frame at the size you give it (1280 × 720 by default; we also ran 3840 × 2160), puts you on the right and scales you to the full height. It is a plain starting point, not a designed thumbnail. For the finished image, the Koldflux YouTube thumbnail checker crops or pads a PNG or JPEG to 3840 × 2160, but its page says it takes input of at most 20 MiB and 4 megapixels, and a 3840 × 2160 image is 8.3 megapixels, so export the flattened thumbnail at about 1920 × 1080 or smaller for it. Its page says padding uses white and does not say how transparency is handled, so give it the flattened export, not the transparent cutout (tool page, read November 27, 2026).

Once you have the PNG, the guide on making a thumbnail covers text, contrast and sizes. If a photo's busy background is the only problem, the guide on blurring a photo background for a thumbnail keeps the background and only softens it. For video, see how to remove a video background in CapCut.

What are the limits of this test?

What this page does not show:

  • Three portraits, one run each, all CC0 files from Wikimedia Commons rescaled to 1600 px. No glasses, hats, hands, two people, long loose hair on a patterned background or transparent clothing.
  • The boxes were placed by hand. The box share counts pixels with alpha 128 or more; it says nothing about how pleasing the edge looks.
  • The brightening was one setting (gamma 0.45), tried once on three photos. It is not tested as a rule and may not help on every photo; the top of the head in the dark photo stayed thin.
  • Real phone photos, HEIC files and photos over 16 megapixels are untested; the script turns a photo upright by its rotation tag, checked only on a synthetic 300 × 100 file (commands.log). The tool's own accuracy test was not repeated. Its numbers (0.86 overlap for people, 16 cutouts) are the tool page's own; the tool page also gives a lower overlap of 0.55 when the background is a portrait photograph and says photos over 25 megapixels are scaled down.
  • Nothing here says how YouTube recompresses a thumbnail after upload; no account was used and nothing was uploaded.

Do it in your browser

Free Koldflux tools, no account needed.

Remove the background from a photo of a person (free, runs in your browser)Check and resize the finished thumbnail image (free, runs in your browser)Blur the background instead of removing it

Questions people ask

How do I remove the background from a photo of myself for free?

Open the Koldflux person background remover, choose the photo and download the transparent PNG. The model runs in your browser and nothing is uploaded. Then check the hair edge on black and on white.

Which file should I download for a YouTube thumbnail?

The transparent PNG. The JPG button saves you on a white background, so it is only useful if you want white. YouTube accepts JPG or PNG for the final thumbnail.

Why did the tool cut off part of my hair?

Probably because the hair is close in colour and brightness to what is behind it. The tool page lists fine hair against a similar colour as a limit. In our street photo a hair box kept 4.4% of its pixels at first; a brightened copy kept 74.0%, though faded.

What is the thin light line around my cutout?

The soft edge of the mask, which let some of the old background show. We saw a pale rim on the wall portrait's left curls. Put the cutout on black and white to find it, and use a frame colour that hides it or erase it in your editor.

Does the cutout keep the picture's size?

On our three photos the PNG had the same width and height as the input (wall photo: 1600 × 1066 in and out). Very large photos are untested.

Can the tool place me on a thumbnail?

No. It gives a cutout. The script's thumb command makes a plain colour frame with the cutout on the right, and for a designed thumbnail you use your editor.

What size should a YouTube thumbnail be?

YouTube Help recommends 3840 × 2160 px at 16:9 for videos, JPG or PNG, with a minimum width of 640 px (read November 27, 2026).

Related

More guides on this topic

Sources and how we checked

  1. Koldflux test log: cutout checks, controls, brightened copies and box shares (our measurement, November 27, 2026) (checked 2026-11-27)
  2. Koldflux command log: every published command with its exit code and an edge case (checked 2026-11-27)
  3. Koldflux cutout_tools.py: the check, lift, reapply and thumb script used on this page (checked 2026-11-27)
  4. Koldflux tool runs in headless Chromium (tool-run-raw.txt) (checked 2026-11-27)
  5. Koldflux person background remover page (its own test numbers and limits; read November 27, 2026) (checked 2026-11-27)
  6. Koldflux YouTube thumbnail checker page (what it accepts, padding colour; read November 27, 2026) (checked 2026-11-27)
  7. Notes from the YouTube Help page: the spec lines quoted here (our copy, November 27, 2026) (checked 2026-11-27)
  8. YouTube Help: Add video thumbnails and playlist cover images (resolution, ratio, formats, file size; read November 27, 2026) (checked 2026-11-27)
  9. Test photo: Confident Eye Contact (Unsplash), Tanja Heffner, CC0, Wikimedia Commons (checked 2026-11-27)
  10. Test photo: Street portrait of a bearded man with curly hair, São Paulo, Wilfredor, CC0, Wikimedia Commons (checked 2026-11-27)
  11. Test photo: Curly hair and freckles man (Unsplash), Jeremy Bishop, CC0, Wikimedia Commons (checked 2026-11-27)

We took three CC0 portraits from Wikimedia Commons (a woman with curly hair in front of a pale wall, a bearded man with curly hair on a busy street, a freckled man against a near-black background), rescaled each to 1600 px on the long side, and ran the live Koldflux person background remover on each in headless Chromium. We checked each PNG with our script (alpha shares, previews on black and white), drew a hair box on the street photo and an ear box on the dark photo, brightened a copy of each photo (gamma 0.45), ran that through the tool too, and measured the same boxes. Controls: a synthetic picture with a known answer, a half-transparent picture, a JPG that must be refused, and the already-good wall portrait through the same brightening. Everything is in public/hub-media/cut-yourself-out-of-photo-for-thumbnail/.