Searching Through Two and a Half Million Photos
How a OneDrive notification led to a photo searcher. One evening, zero euros, and three adjustments with a single question.

Figure 01.0 — Searching Through Two and a Half Million Photos
It all started with Microsoft. Today, a neat notification: "Your OneDrive is 336 percent full, you need to do something about it."
336 percent. Not 99. Not 104. Three hundred and thirty-six.
It makes sense — we went from having a vast number of users to just a few, and suddenly your data starts to pile up. So, I started tidying up. Everything neatly archived to the PB disk: our NAS (it's a hard drive, but with many that back each other up, so a backup that backs itself up....) yes, a nerdy thing.
It's filled with Perfectly Basics history, which, to be honest, we no longer used, but it was fun to browse through sometimes, seeing all the things we created, WTF! It was a top team back then.
And then I looked up. I thought... but wait... all those photos...
Product photos. So many product photos... almost millions...
All those years of shoots with the lovely Nic and Celine, our stars, not that we were going to do anything with the photos anymore. But one question that wouldn't leave my mind: how do you ever find anything in this again? Suppose... How do you find that one product among almost millions of photos? Suppose we ask if Nic wore "that jumper" with the red trim back then....
I get so excited about that.... :) #adh?something yes, busy in the head, Pete.
Claude Code added. Let's delve into it. #steponthegas because now we're going to find this.
The Status After Tonight
2,543,212 photos indexed (and counting)
1,510 lines of code
10 commits
€0 external costs
0 unreadable files
Everything runs locally on the Mac. No cloud, no credits, no additional subscriptions — I have enough of those already.
How It Works
A small program now runs on the Mac, working through the PB disk (NAS system with all the photos) via the internal network. Photo by photo.
And now the trick — because I find this the most beautiful. The program doesn't look at a photo like we do. It doesn't remember details, pixels, or file names. It creates a kind of fingerprint for each photo: a long string of numbers that summarises what's in the photo. The garment, the colour, the print — all compressed into one code.
And here's where it gets clever: photos that look alike receive codes that resemble each other. Searching then is no longer about browsing through one and a half million images, but simply calculating: which codes are closest to each other? That's why there's a little number under each thumbnail in the search screen — that's the score, indicating how close that photo is to your search query.
And during indexing, questions arise that you never think of beforehand. How many results do you want to see per shoot — everything, or a maximum of three so you see more different products? Do you include accessories and detail photos, or not? You answer them one by one as you go, and each time the searcher becomes a bit sharper. They've now just become buttons on the screen.
Because that search screen, that's where it gets fun. Just in the browser. You type "yellow dress", and a moment later your screen is filled with Nic and Celine in all the shades of yellow we've ever shot.
But the best part: you can also drag a photo of a garment into the screen — or simply paste it with ⌘V — and then it searches based on that image. Because that's the elegance of those fingerprints: your search terms also become one, and a pasted photo just as well. Text and image suddenly speak the same language of numbers. No words needed. Photo in, results out. Is there still a sample in the studio that no one remembers which season it came from? Take a photo, paste it, and the searcher tells you exactly which shoot it was in.

This Is What It Looks Like
Show Image
Searching for "yellow dress". At the time of this screenshot, there were 132,167 photos in the index — the counter continued during the search. And there they are: Nic and Celine, in all the shades of yellow we've ever shot. Each thumbnail with a score, shoot date, and folder name underneath. As if the entire NAS suddenly provides answers.
What It Can and Cannot Do
To be honest: a plain black jumper is the hardest thing there is. And with those fingerprints, you immediately understand why: all plain black jumpers receive almost the same code. Try distinguishing ten identical black jumpers yourself — the searcher can't do it either.
But give it a print, and something beautiful happens. It not only finds that dress again, but also the same print on a shoe, a belt, and a scarf. Whole sets that you had long forgotten existed come back with a single search query. That's where the magic lies.
Tonight
As I write this, the index continues to run. The Mac is plugged in with the lid open, working its way through the remaining images on its own.
Tomorrow morning, first ./draai.sh status.
From a OneDrive that was 336 percent full to one and a half million searchable photos of our entire history. In one afternoon. We no longer used the NAS for anything. Now it provides answers.
And onwards. Peter.


