Lightroom turns the stored corners around the crop centre, so writing the levelled rectangle made the crop Custom. The file now stores those corners, the original is found by its own hash, and edits already queued go out while the socket stays up.
20 KiB
Photo editing rules (autopilot and automatic crop)
What the automatic editor may do to a news or sports photo, and how it chooses. These rules are the contract for
apps/api/src/composition/ and apps/api/src/autopilot/. Peter (and any editor) can tighten them per
organisation or event; nothing here may be loosened past the ethics section.
1. Ethics (fixed)
Following the AP and NPPA codes:
- Allowed: crop, straighten, white balance, exposure and contrast, colour and toning "minimally needed for clear, accurate reproduction", conversion to black and white, dust removal.
- Not allowed: adding, removing, moving or cloning anything in the scene; blurring or darkening the background to hide it; changes of density, contrast, colour or saturation that alter the scene; obscuring faces.
- A crop must not change what happened. If removing someone changes the story (the defender in a duel, the referee showing a card, the goalkeeper facing the shot), they stay.
- Every automatic edit is an ordinary, undoable step in the photo's edit history, marked as made by the autopilot. The original is never touched.
2. Crop
- Best effort, original aspect: every crop rule below is "when possible". The autopilot never changes the photograph's aspect ratio. Lead room, cleaning edges, and tightening stay inside that ratio; if they cannot be met without another format, keep the best crop in the original aspect (or leave the photo as shot).
- Who: the subject is the person the camera focused on, when the file has a focus point (EXIF SubjectArea: the autofocus point, shown by Photo Mechanic) and that person is sharp with a fully visible face. A soft or faceless body in the foreground or background (AF landed on the jump in front, or a blur behind) is scenery — never the crop's subject and never used to expand the framing — when a sharp face sits in focus. With no usable point, the subject is the sharp person with a face, not the biggest one. With a ball in play, the ball and the sharp people contesting it come along (soft bodies near the ball stay out of the subject box). Without one, the subject and the sharp people with them (a duel, a celebration, a line-up). Non-person photos (empty pitch, kit detail) are unchanged.
- Who is not the subject: they are in whole, or they are out. A player who is large in the frame (close to the camera, or nearly as tall as the subject) is part of the photograph: the crop does not throw them out and does not cut through them. If keeping those players means there is nothing to crop, the photo stays as shot. A small figure in the background, a blurred body in front, and a person the photo has already cut in half may stay out. When leaving them out would cut the subject or the ball, the crop does the best it can. The subject themselves may stand at the frame edge. A correction learnt from other photos must not chop a player this frame had kept whole.
- The ball depends on the sport of the event. Handball plays the ball in the hands or in the air. A ball below the knee is on the floor: it does not frame the photo, even when it overlaps the player's legs and sits closer to the middle of the body. Football plays the ball on the ground, so the ball at the feet is the one that stays. A spare ball that nobody is playing never wins, in either sport.
- Shape: the autopilot keeps the photograph's own aspect (non-negotiable). The crop may move anywhere across the frame, including a tighter window, but it is not turned into another format. A square, a 4:5, a 16:9, or a portrait crop of a landscape frame is not an autopilot crop. An editor, by hand, may still choose another aspect. A file written for Lightroom stores a straightened crop as the corners Lightroom turns back around the crop centre, so the crop tool still shows this aspect. Writing the levelled rectangle together with the angle makes Lightroom call it Custom.
- Lead room (sport): leave space in the direction the player looks or runs; put their back nearer the opposite edge. Dead space behind the facing direction is wrong. Without a reliable facing signal (face on the body, or the ball in play), keep the subject centred as before. Reportage and open team frames do not force lead room.
- Wide end of a zoom: when the file shows a zoom and the focal length is at (or very near) the wide end (e.g. 15–35 mm at 15 mm), the wide plan is intentional. Do not reframe aggressively — typically only straighten. A tele zoom (70–200 at 135 mm) may still be cropped; the photographer could have zoomed in.
- Context: a generic event (no opponent, no fixture) is reportage. A match is sport, and a photo of that match with no ball in play is cropped as a person. Reportage does not use the handball cut.
- Framing (per event, sport only):
- "tight" (default) is the agencies' handball framing, measured on kolektiff images (600 EHF/IHF photos of 2025-26). With a ball in play, the subject is about as tall as the crop and a leg may be cut mid-shin or mid-thigh when the foot already leaves the photo. The face is big (a median face of 14% of the frame height) near the top.
- "full" keeps whole bodies when they fit: Peter's usual crop, about two thirds of the frame.
- Reportage reads the shot the way a picture editor does. One clear person is the subject — someone walking in the middle, a suitcase or a bag beside them — even when they take less than half the frame. The crop keeps the whole body and what they carry, cuts empty floor and edge clutter, and keeps the photograph's aspect. It does not say there is no subject. It is not a sports fill. A conversation (several people whose bodies are whole) stays as framed. A distant figure, under about a fifth of the frame, is the place and stays. A figure that already fills the height stays. A zoom at its wide end stays. A frame the camera already cut (the feet leave the picture, and the person is large) is only finished, at mid-limb, and a person the frame already cut off at the edge is left out. The sports framing on the event is ignored, including a crop learnt from matches. A later frame of that moment may still be a half or a three-quarter. A whole hand and a whole foot stay in. A person the frame has already cut in half is not pulled into the subject.
- Never cut: heads, faces, a hand or a foot that is whole in the photo, hands holding the ball, the ball itself. A person who is in the crop keeps their head, including someone a little less sharp stood in the shade. In reportage the people of a conversation are one subject, so the crop is built around all of them.
- Limbs: if a body has to be cut, cut mid-limb (mid-thigh, mid-shin, mid-forearm), never at a joint (ankle, knee, hip, wrist, elbow, neck). The engine estimates joints from the body box and avoids crop edges there.
- Feet and hands: a foot or a hand that is whole in the photo stays in the crop. A foot keeps a little ground under the sole. Cutting the shoe, the ankle or a hand just to fill the frame is not allowed. When the foot already leaves the photo, the crop ends mid-shin or mid-thigh. It does not stop on the sock. Never at a joint, and never through the ball.
- Edges: no slivers of other people at the crop edge: either in, or out — including soft / out-of-focus fragments and a finger or tiny body part of another athlete. Prefer a tighter clean frame to leaving that scrap in. Soft people are scenery to remove when possible, not framing anchors. In reportage this is absolute for anyone still reasonably sharp: the crop keeps their head, and the primary crop keeps their feet when those feet are in the photo. A half or a three-quarter may end at the waist, and it still starts above the head. A band through the chest is never a crop.
- A bust is not the subject. A head in a window, or a torso the detector stopped at the chest, does not beat a whole figure standing in the same photo. The taller person, closer to the camera, stays in the frame even when someone behind them is a little sharper.
- Stray limbs: a hand or a foot of someone who is not the subject, and nothing more of them, is cropped out so the frame stays clean. So is a person the photo already cuts in half at the frame edge, when they are not the subject. A whole other person is not that: they stay in or go out, they are not sliced.
- Headroom: heads a little below the top edge, not touching it, not floating in empty space.
- Vertical placement: the upper body (chest, faces) a little above the middle of the crop, never the knees. Little or no empty pitch or floor under the feet: when the crop is taller than the subject, the spare height goes above them (crowd, stands), not below.
- Distracted: prefer the crop that leaves out half-bodies, empty floor, advertising boards and bright clutter at the edges, as long as nothing that matters goes with them (same aspect). A cleaner alternative wins.
- Level vs subject: prefer not to straighten (or reduce the angle) if leveling would chop a foot, hand or head of the subject that the crop had kept. The subject intact beats a perfectly level horizon.
- Resolution: never crop below what the delivery needs. Default: the crop keeps at least 2400 px on its long edge of the original (configurable per organisation; agencies often ask for more). On a large file the floor is 3000 px, not 35% of the frame (that held a modern body near 4000 px). An export at 4000 px enlarges that crop, and only that far (at most a third). A smaller file is not blown up.
- Not too much: if the only crop that works is tighter than the resolution allows, keep the wider frame. A good
photo uncropped beats a bad crop. The floor is the organisation's
minLongEdge(default 2400 px on the long edge of the original, and never below the 3000 px large-file floor). A crop that only clears that floor by a few percent is refused: needing a super-reframe or that much cut means the subject or the moment was misread. Prefer another frame of the burst, or leave the photograph as shot. - Not for nothing: a crop of more than 92% of the width is not made: the photo stays as shot. The agencies send a fifth to a half of their photos uncropped (Getty, AFP, Paris 2024).
3. Bursts (sequences)
A camera at 10–30 frames per second sends several photos of the same moment.
- A burst is a run of photos from the same camera with less than 1 s between frames (configurable; was 1.5 s).
- Score of each frame: sharpness of the subject (focus landed on them, no motion blur), subject size, ball in frame and near the subject (peak contact preferred: ball closest to the body), faces visible. Ties go to the earliest frame (usually the peak of the action).
- Facing and eyes: inside one burst, a frame of a player from behind loses to a frame where the face is visible, and shut eyes lose to open ones. Open eyes always win when the burst has both — including a shot or a grimace, and including when the blink is sharper: if another frame of the same moment has the eyes open, that one is kept. If every frame is a back, or the eyes cannot be told apart, the sharpest frame stays. A back is not dropped from the match when it is the only picture of that moment. One closed face in a group is enough to lose the frame in reportage.
- Clear face: prefer a frame whose subject's face is sharp and unobstructed. When the same burst has one with a clear focused face, do not pick a frame where an arm, another player or the ball covers that face. Only the occluded / soft-face frame may stay when it is the only picture of that moment.
- No usable face: do not pick a frame whose subject has no clear face when the same burst has one that does. A photo that is not of a person (empty pitch, kit detail) is unchanged.
- Keep: the best 1–2 frames per burst (configurable), flagged as picks. The rest stay unflagged (never rejected or deleted automatically).
- Reportage sequences: when three or more frames of one moment are sharp, keep up to three (even if the event asked for fewer) and give them different plans: whole body, half body, three-quarter. More than three of the same moment is too many. The half and three-quarter cuts sit mid-limb, and only when the file still has the delivery's resolution. A blurred sequence stays at the event's number.
- Variety (sport): when two frames of a burst are kept, the second gets the other framing so the client has a choice. After a tight first pick, the second gets the wider, whole-body frame with context, as Getty mixes in. Otherwise the second is slightly tighter.
- Saturation: an event can cap how many picks one burst, or one minute of play, may produce, so a long attack doesn't flood the delivery.
4. Autopilot
Per event (and an organisation default), off unless switched on. The same pipeline runs on the desktop
(apps/app/src/offline/autopilot.ts) and on the server worker; the desktop must not wait for upload to
cull or edit. When on, every photo that arrives through FTP, the local FTP of the desktop app or auto-ingest
is, in order:
- analysed (people, ball, focus, eyes when faces are known) and scored — not developed yet;
- scored within its burst; when the burst ends, its best frames (clear face, open eyes preferred) are flagged as picks;
- only the picks are edited: white balance, tone, level (horizon or verticals, at most a few degrees), crop, and the finishing look. The rest of the sequence stays as shot (and need not be uploaded for that decision). The level prefers the camera's own electronic level (Canon LevelInfo / RollAngle — the viewfinder level, including when it lives on the original CR3 rather than the JPEG). A level camera stays level: a brick wall must not tilt the frame. Straightening must not chop a foot, hand or head the crop had kept — reduce or skip the angle first. With no roll in the file, the level reads the advertising boards, stands, posts and railings, never the pitch markings (lines on grass), which perspective tilts; when those disagree it falls back to a general Level; when nothing agrees the photo is left as it is. A ball in play stays inside the crop, including one in an outstretched hand. Leaving it outside is the same as cutting it;
- optionally delivered (rendered with the edits, IPTC from the event) to the event's delivery target. When the desktop already edited a pick offline, those edits sync with the photo; the server does not overwrite them.
Look (per event, apps/api/src/autopilot/look.ts): fixed values on top of the measured tone, the same for
every photo of a match. They never go over a measured control.
- "none" (default): white balance and tone only — no creative look ("no filters").
- "agency": kolektiff's punchy kits. Vibrance +18, saturation +4, clarity +8, texture +6, and shadows a touch blue-magenta. Every agency measured has that last trait: Getty, AFP and kolektiff all do it.
- "natural": Getty's more natural colour.
- Both looks add capture sharpening (40, radius 1, masking 35), colour noise reduction, and luminance noise reduction by ISO (from ISO 1600). Clarity, texture and sharpening are sized for the whole frame and applied with the tone, before the crop takes effect: a crop that keeps half the frame keeps half of that strength (never under a third), so a tight portrait does not grow a halo. There is never a vignette or a local change (§1).
Defaults follow the agencies: white balance on (neutral whites) and 75% of the automatic tone (full range, pure blacks). Highlights and shadows in that automatic tone are one fixed recipe from raw files, not a reading of the photo. On a camera JPEG the full recipe greys whites and flattens faces, so the highlight pull stops at −20 and the shadow lift at +30.
Uploads made by hand in the browser are not touched. Anything the autopilot did can be undone, changed or reset in Revelar.
Learning from corrections
This runs already — it is not a future wish. When someone changes a photo the autopilot edited (in Revelar, or by
writing a soft crop into the file in Lightroom / Photo Mechanic on the desktop), the difference (final minus
autopilot, per control; and the crop area against the autopilot's) is kept, one per photo, latest state wins
(develop_corrections, apps/api/src/autopilot/learning.ts). The desktop and the server both apply that style on
the next picks (desktop caches it for offline; it refreshes when the network is up). For the next photos of the
same photographer the autopilot adds, to its own measurement, the median of the last 60 corrections, at the same
venue when there are at least 5 there:
- only the controls it sets itself (tone, white balance) and crop tightness, never a creative look;
- only with 5 or more corrections, and only when at least 70% of them go the same way (one odd photo changes nothing); tiny differences are noise and very large ones creative choices, both ignored;
- the crop is read on the person, not only as a ratio: where the bottom cuts the body (chest, waist, mid-leg, feet), space above the head, and whether the sides take the arms. When those agree, the next crop is placed the same way on the next person. A plain tighter or looser frame is only the fallback when the body position was not known. Opening a crop the autopilot made too tight teaches it to leave more room next time. A learnt crop still may not slice a ball the frame had kept whole.
The autopilot's panel in the app shows what it has learnt and has "Esquecer". The burst picks are not learnt yet.
5. Only the best
Some clients (ZeroZero) want a short gallery of the match, not every usable frame. With "Só as melhores do
jogo" / "Melhores…" the autopilot still flags each burst's picks for the photographer, but delivers a curated
set. The number the photographer (or the event) asked for is a hard target: fill up to that count from the
best remaining frames when the time windows alone fall short (apps/api/src/autopilot/best.ts fillToCount).
Never stop around a hundred when they asked for two or three hundred and usable frames remain.
With autopilot "only the best", windows still shape the first pass (apps/api/src/autopilot/curate.ts):
- the match (from kick-off, its typical length by sport: football 115 min with the break, handball 80) is cut
into 5-minute windows; each window may add its share of the gallery, and a share it did not use (the break,
a quiet spell) carries forward, at most three windows' worth at once. The size is a target (
galleryCeiling): a rich match may add about 15% (at least 2 frames, never more than 25 past the number) from frames at or above the match's typical one; a thin match stays under; - one candidate per burst (its best frame), ranked by game moment: the frame score, more with the ball in play (×1.3), a duel or a celebration (several people in the subject), less when the subject is small (far away); the photographer's stars count (+20% each), a rejected frame never goes;
- frames well below the match's typical frame (half the median) are left out even when the window has room, and never two frames of the same moment on the same destination (5 s); with N configured exports, up to N best frames of a burst leave together (one per destination);
- warm-up and line-ups (more than 5 minutes before kick-off) are not candidates;
- a window is decided a minute after it ends, so the gallery reaches the client with about 6 minutes' delay.
After the match, "Melhores…" in the library sends the best N of the event the same way (filling up to N with the best frames left when the windows' shares fall short); without the autopilot, stars and picks rank.
Sources
- AP and NPPA codes, summarised by the CUNY Newmark J-School: https://photo.journalism.cuny.edu/?p=201
- Cropping at mid-limb, not at joints; keep meaning; avoid clutter: https://www.walsworthyearbooks.com/top-10-essential-rules-for-good-photo-cropping/
- Burst culling criteria (subject sharpness, eyes, ball, peak action, 1–3 per burst): https://filterpixel.com/blog/sports-photography-burst-mode-culling
- Sports composition (lead room, face, fill the frame): https://www.ttlsports.com/composition-techniques-for-sport-photography
- Sports burst culling (occlusion, peak contact, clear face): https://imagen-ai.com/valuable-tips/how-to-do-photo-culling-for-sports-photographers/
- Peter's own Lightroom crops (65 picked photos, handball, October 2026): crops in the photo's aspect, often exactly two thirds of the frame, straightening of 0.5–3.3°.