Skip to content
Zac Walker edited this page Nov 26, 2026 · 1 revision

Diffractor can find the faces in your photos and videos and help you name the people in them. Everything runs on your PC: no picture, face or name is uploaded. The website explains naming faces step by step; this page explains how it works underneath.

Three kinds of knowledge

Diffractor keeps three things apart, because different parties vouch for them:

What it is Where it lives
Names in files Face regions and person names another organizer, or you, wrote into a photo's metadata The photo, or its XMP sidecar. Searchable even with face scanning off
Faces found Each face's box, landmarks and a 128-number signature, found by scanning The index. A cache: it can always be found again
The face book Whom you confirmed, whom each face is not, and which faces you hid diffractor-people.db. Not a cache: back it up with Export face data

Names Diffractor reads from files are described on the Metadata page.

Scanning

Scan for faces in the Faces view (F8), the sidebar or Options turns scanning on. Scan for faces in photos and Scan for faces in videos choose what is read. Before it starts, Diffractor says how many files it will read and roughly how long that takes, reckoning that each worker reads five photos a second, or a video in four seconds; once scanning, it uses the rate it measures.

  • The picture on screen goes first; then a folder at a time, the folders with the newest pictures first.
  • A few workers read faces: a quarter of your processor's cores, between one and four. Indexing has priority over face reading, and on a hard drive or a network share the two take turns rather than competing for the disk.
  • A file held only in the cloud is never downloaded to be scanned. A drive or share that is not connected is waited for, not counted as a failure.
  • Pause keeps what was found and stops reading, across restarts, until you resume.
  • A photo is read once. Diffractor's own metadata writes, and turning a photo by its orientation tag, do not make it be read again; any other change to the file does.

Videos

A video is read at its key frames - frames stored whole, which decode on their own - so nothing is decoded through. Its length is divided into 256 parts and the first key frame in each is read: a phone video of up to about four minutes is read at every key frame, a film at 256 frames spread through it.

The faces of all those frames become one record with one face for each person, their clearest. A video keeps up to 64 people, each with the stretches of the video they appear in. A face seen once, briefly and unclearly, is dropped as likelier a passing shape than a person. Those stretches are the orange marks on a video's timeline when a search finds it by a person.

How a face is found and compared

  1. Detection finds each face's box and five landmarks - eyes, nose and mouth corners - with YuNet, the network from libfacedetection. It looks at a copy of the picture reduced to 640 pixels on its long edge, and reports faces of at least 70% confidence and 3% of the picture's short side. On a close-up, or when there are signs of distant faces, it looks again at another scale.
  2. Alignment turns and scales each face to the position the recognizer was trained on, from a copy of the picture fitted within 1600 pixels.
  3. Embedding: SFace, from OpenCV Zoo, turns the aligned face into a signature of 128 numbers. Two signatures of one person point the same way; how alike two faces are is how closely they do.
  4. Quality: each face keeps its confidence, its size and how square-on it is. Only good faces - large, square-on and clear - form the groups in Unknown, and are used as a person's portraits. Every face is still compared, so a blurred face in a crowd can still be suggested.

Both networks are compiled into Diffractor through libmug; nothing is downloaded. A photo keeps at most 64 faces.

Suggestions

Each person you name gets a profile: up to 64 of their confirmed faces, kept as individual appearances rather than an average, so a child photographed over the years is recognized at different ages. A face nobody has placed is suggested for a person only when:

  • it resembles them closely enough,
  • it resembles them clearly more than anyone else it could be, and more than the faces you ruled out for them, and
  • nobody is already confirmed or suggested for another face of the same photo.

A suggestion never becomes a name by itself: it waits on the person's page for you to Confirm it, rule it out with Not this person, or name it as someone else. Every confirmation teaches Diffractor another look of that person, and every rejection a lookalike to keep apart.

A photo whose metadata names one person, without saying which face, and which holds exactly one face, suggests that face for them.

Lookalikes and children

No threshold separates every pair of people. Young children, siblings most of all, often resemble each other more than an adult resembles themself across the years. So Diffractor compares rather than measures: a face goes to the person it most resembles, by a margin, or nobody. When it cannot tell two or three people apart, naming the face offers all of them and lets you choose. Confirming examples of a child at different ages helps.

Faces in paintings, statues and cartoons are found too, and resemble each other more than people do; they gather in Unknown's groups, where Hide all puts them away.

Searching

You type Finds
person:"jane doe" Photos and videos naming her, or with a face confirmed or suggested as her
person:jane! The same without suggestions
with:person, without:person Photos that name someone, or nobody
@face Photos and videos with at least one face found
face:IMG_1234.jpg:2 Photos and videos with a face resembling the second face found in IMG_1234.jpg. Faces are numbered left to right, then top to bottom

The search reference lists them all. Names in files are found without scanning; the face book's decisions and suggestions need it.

Your decisions follow your photos

A decision about a face is kept by the face's signature, not by where the photo is. So nobody sorts a face twice:

  • A photo renamed or moved by Diffractor takes its decisions with it, and a folder those of everything in it.
  • A photo renamed or moved by another program gets them back once it is scanned again.
  • A photo whose pixels change is read again, and each decision goes to the face found again that matches its face closely.
  • Copies of one photo share their decisions.

The face database and its backups

The face book is diffractor-people.db, beside the index: see where Diffractor keeps its data. Each change is written as you make it. Only one Diffractor window can change faces at a time; others show them read-only and take over once the first closes.

  • Export face data saves your people, their former names and your decisions to a CSV file, which Import face data reads back on this PC or another. The file holds face signatures and names but no file names or folders. It identifies people, so keep it private.
  • Importing joins people by name and never overrides a decision already made here: a local rejection blocks an incoming confirmation, and importing the same file twice changes nothing.
  • Delete face data removes everything scanning found and turns it off. Tick Also forget names and review decisions made in Diffractor to clear the face book too. Deleted data is overwritten in the database files rather than left in their free space.
  • Rebuilding the index removes what scanning found, but keeps the face book.

What is written to your photos

Names you give in Diffractor stay in its face database; they are not written into your photos. The one exception is renaming a person whom your photos already name: Diffractor offers to Change in files, which writes the new name into those photos' face regions in the standard Metadata Working Group format, or Only in Diffractor. Face signatures, rejections and hidden faces are never written to a file.

Privacy

Detection, comparison, suggestions and search run on your PC with no network access. Nothing about a face is written to Diffractor's log. A crash report, sent only from the Windows installer edition and only when you allow it, includes a memory snapshot that could hold face data being processed at the moment of the crash. An AI assistant you connect sees the names and faces its tools return.

Clone this wiki locally