TipClique
Menu

How to swap a face in Photoshop

Swapping a face

To swap a face in Photoshop, drag the source face onto the target photograph as its own layer, drop it to 50% opacity, align the eyes and the mouth with Free Transform at Ctrl T, then hide the join with a layer mask and match the colour. Verdict: CURRENT. This is still a manual composite and no button does it. What the software absorbed is the selection either side of it, since Select Subject and Remove Background now run in one click from the Contextual Task Bar. Two things give a swap away every time: the edge and the colour temperature. Everything below is arranged around those 2.

CURRENT

Two identically lit heads, which is the condition that makes a swap possible at all.

The swap, step by step

The swap begins before Photoshop, with the choice of source frame, and that choice decides more than any later step. Pick a source shot at a similar focal length and a similar head angle, because a face photographed at 35 mm has a larger nose relative to its ears than the same face at 85 mm, and no blending corrects a perspective mismatch. Check the catchlights in both sets of eyes: if the source's highlight sits at 10 o'clock and the target's at 2 o'clock, the light came from opposite sides and you should reject the frame rather than fight it.

  1. Open both files as tabs, and decide which one is the target, meaning the body, pose and background you are keeping.
  2. Draw a loose Lasso selection at L around the source face, generously, taking in forehead and jaw. Precision here is wasted, because the mask does the real cutting later.
  3. Copy with Ctrl C, switch tabs, and paste with Ctrl V, or drag between tabs with the Move Tool at V.
  4. Set the face layer to 50% opacity so the target shows through it.
  5. Press Ctrl T and align 3 points only: the 2 pupil centres and the centre of the mouth. Rotate to match the eye line, scale to match the pupil distance, and ignore the outline entirely.
  6. Return the layer to 100% opacity and add a layer mask.
  7. Paint black on the mask to hide the source's own hairline, ears and outer jaw, leaving the eyes, nose and mouth.
  8. Match the colour, then match the grain, then check at 100% and again at 25%.

The step that goes wrong is 5. People align the outline of the face, which produces a head of the wrong width sitting on the right shoulders. The eyes and mouth carry recognition; the outline is mostly hair and jaw shadow and you are going to mask it away.

The first tell: the edge

The edge betrays a face swap because the mask was painted around the face, and a real face has no boundary. It meets hair as individual strands, and it meets the jaw through a shading gradient the camera made. A soft round brush makes a different kind of gradient, and the eye reads the difference instantly even when the viewer cannot say what is wrong. 3 symptoms recur:

  • A soft halo, from feathering the seam by 30 or 40 px to make it disappear, which instead produces an airbrushed ring around the features.
  • A doubled hairline, where the source's own hair survives inside the target's and 2 hairlines run parallel about 10 px apart.
  • A seam crossing open cheek or forehead skin, which is the worst possible place for one because there is no existing edge to hide behind.

Put the seam where the picture already has an edge: inside the hairline, along the top of an eyebrow, under the jaw in the shadow, or at the neck crease. Then feather that seam by 1 to 2 px and no more. Use a small hard brush along feature lines and a soft brush only across broad shading. Match sharpness too, since a sharp source pasted into a slightly soft target reads as stuck on: a Gaussian Blur of 0.3 to 0.8 px on the face layer usually settles it. Finally, let grain cross the join. A clean face inside a grainy frame shows its outline through the absence of noise, so run Filter > Noise > Add Noise on a 50% grey layer set to Overlay across the whole composite once the swap is done.

The second tell: the colour temperature

The colour temperature betrays a swap because the 2 photographs were lit by different sources, and skin records that difference more visibly than any other surface. Domestic tungsten sits near 2700 K to 3000 K, direct midday sun near 5500 K, and open shade under a blue sky near 6500 K to 7500 K. Skin under tungsten is orange with yellow shadows; skin in open shade is pink with cyan shadows. Paste a 3000 K face onto a 6500 K head and the cheeks are warmer than the ears and the neck, which is a mismatch nobody names and everybody sees.

3 ways to fix it, best first:

  1. Correct before compositing: run Filter > Camera Raw Filter at Shift Ctrl A on the source layer and move Temperature and Tint until a neutral patch in the source reads like a neutral patch in the target.
  2. Match by numbers: open Window > Info, hover over the target's forehead and note the R, G and B values, hover over the same place on the source, then clip a Curves layer to the face and move each channel until the 2 readings agree within about 4 levels.
  3. Match by command: run Image > Adjustments > Match Color with the target document set as the source, then pull Fade back, because it overshoots.

Read the numbers rather than trusting the screen. Your eye adapts to a colour cast within seconds of looking at it, which is exactly why the mismatch survives your check and does not survive anyone else's first glance.

Auto-Blend Layers, and when to hand over the seam

Auto-Blend Layers builds the masks for you and equalises tone across the join, which is worth trying when the 2 exposures are already close. Delete or mask the target's own face first, or there is nothing for it to blend into. Then select both layers in the Layers panel, take Edit > Auto-Blend Layers, choose Panorama rather than Stack Images, and tick Seamless Tones and Colors.

It is fast and it is blunt. It will blend away an eyebrow if the eyebrow happens to sit where it wants the seam, and it writes new masked layers over your originals, so duplicate the group first. Treat the result as a starting point and then repaint the mask by hand along the feature lines described above. The blend modes involved in the tone matching, and what each one does, are set out on the blend modes page.

The jersey swap, which is the same problem wearing fabric

A jersey swap carries the same 2 tells plus one of its own: fabric folds, and a flat replacement does not. Recolouring is straightforward, and the graphics are where it fails.

  1. Mask the jersey, using Select > Color Range to select by colour where the shirt is a strong single hue, then cleaning the mask by hand at the collar and sleeve edges.
  2. Add a Solid Color fill layer clipped to that mask and set it to Multiply, so every fold and shadow already in the shirt shows through the new colour instead of being painted over.
  3. Place the new number or badge as a Smart Object, then bend it with Edit > Puppet Warp, or with Filter > Distort > Displace using a displacement map built from the original shirt's own luminosity, blurred by 2 to 4 px and saved as a separate .psd.
  4. Set the graphic to Multiply as well, or clip a Curves layer to it that reproduces the shirt's shading.
  5. Check the collar, the cuffs and the shoulder seam, because a recoloured body with an untouched white collar reads as a paint job in under a second.

Backgrounds, and the honest use of a swap

Deleting a background is now the easiest part of the job: Remove Background in the Contextual Task Bar detects the subject and creates a layer mask that hides everything else, and Select Subject makes the selection alone from the same bar, hair and other fine edges included. Photoshop Elements carries the same Contextual Task Bar. Do the background last on a composite, though, because a mask cut before the face is aligned will be in the wrong place afterwards. The full treatment, including the cases where the automatic selection loses, is on Removing a background in Photoshop, and the wider index is Photoshop, operation by operation.

The technique does not decide what you are doing with it. Replacing a blinking relative's face with their own face from the next frame of the same group shot is repair. Putting a real person's face into a photograph they were never in, in a setting that changes what they appear to have said or done, is a different act with a real subject at the other end of it, and the correct time to think about that is before step 1 rather than after step 8. Swap faces of people who have agreed to it.

If you are following this without a desktop subscription, the free tier described on Photoshop on a phone carries selections, layers, masks and compositing, which covers the alignment and masking stages; GIMP, Krita, Photopea and Paint.NET are named in full on the free alternatives page.

Where to go next