Glossary · Technology
Re-encoding
Re-encoding is decoding an image file and writing it out again as a fresh file, usually in a standard format and size. Services do it to uploads for safety and privacy: it strips embedded metadata, neutralises malformed files that could exploit decoders, and normalises size and format before anything downstream reads the image. It changes the file, not what the picture shows.
Updated November 6, 2026 · 2 min read
Why do services re-encode uploads?
- Privacy: EXIF metadata, including GPS location, is not carried into the new file.
- Safety: image decoders have had vulnerabilities; a file that is decoded in a sandbox and rewritten cannot carry a crafted payload further.
- Consistency: every downstream step sees the same format, colour space and size.
- Verification: before re-encoding, the real file type is checked by its leading bytes, so a renamed file cannot pass as a JPEG.
What happens to the picture?
Pixels are preserved within the limits of the output format. A lossy format such as JPEG or WebP loses a little detail at each generation; a lossless one such as PNG does not. For face detection and embedding, a single re-encode at good quality makes no practical difference. Heavy downscaling does: a face below about 60 pixels across starts to fail detection.
Where does it come up in face search?
At upload. An engine that re-encodes the query photo can state that the file it processes carries no metadata and matches the declared type. FaceSearch describes exactly this step: magic-byte check, then re-encode, before the face is detected. Engines that skip it may read, store or log the original file, which is a question worth asking any service you upload a photo to.
| Step | Common choice |
|---|---|
| Type check | Leading bytes compared with an allow-list (JPEG, PNG, WebP) |
| Output format | JPEG or WebP at high quality |
| Size | Longest side capped, often 1,000 to 2,000 pixels |
| Metadata | Dropped entirely; orientation applied to pixels first |
| Colour | Converted to sRGB |
Where does it go wrong?
Dropping orientation metadata without rotating the pixels leaves the face sideways, which detectors handle poorly. Aggressive compression can soften small faces. And re-encoding removes evidence: a photo stripped of EXIF cannot later be tied to its camera, which matters for provenance work described under image provenance and metadata.
Questions
Does re-encoding change how a photo matches?
Not materially at good quality. Faces are compared from pixels, not from file bytes.
Is a re-encoded file still the same photo for copyright?
Yes. Copyright is in the image, not the file encoding.
Sources
- 1.sharp, high performance Node.js image processing (documentation) (checked November 6, 2026)
- 2.OWASP, File Upload Cheat Sheet (checked November 6, 2026)
Entry reviewed November 6, 2026. Found an error? Tell us.
Related entries
- Term EXIF metadata EXIF metadata defined: the camera, time and location data embedded in photo files, what it can reveal, which platforms strip it, and how to remove it before sharing.
- Term Face detection Face detection defined: locating faces in an image with boxes and landmarks, how it differs from recognition, common detectors, and the failures that limit a search.
- Concept Image provenance and metadata What EXIF metadata, platform identifiers and C2PA content credentials reveal about a photo, who strips them, and how provenance helps or fails when tracing an image.
- Engine FaceSearch (facesearch.cc) FaceSearch (facesearch.cc): normal and deep search over the public web, a free first search, three paid plans, email removal, apps. By this wiki's publisher.
Cite this entry
FaceSearch Wiki editors. "Re-encoding". FaceSearch Wiki, updated November 6, 2026. https://facesearch.wiki/glossary/re-encoding/