
Description
A studio ID photo costs a fair bit, and shooting one at home on a phone is doable — the hard part is everything after: replacing the background colour, straightening a tilted head, cropping to one-inch or two-inch sizes, and laying several onto one print sheet to save money. Doing all that step by step in Photoshop takes an unpracticed person half an hour per photo.
LiYing automates that entire studio post-processing pipeline as an open-source program. Drop in a photo and it detects the face and body, corrects the tilt, cuts out the subject and swaps in a red, blue or white background, crops to the ID size you want, and even lays the results out for printing — filling a 6-inch sheet with multiple copies ready to take to a print shop.
The chain is: load image → detection and correction → background replacement → size adjustment → auto layout, none of it needing manual work. Handy for your own application photos, sorting out one- and two-inch photos for family, or a small studio doing volume.
Written in Python with both a CLI and a GUI, supporting custom sizes and background colours. AGPL, 3.3k stars.
Face and body detection: Automatically finds the face and body in a loaded photo as the basis for cropping and layout, with no manual selection.
Automatic straightening: Detects a tilted subject and corrects it, so a crooked shot still yields an upright ID photo.
Cutout and background swap: Separates subject from background and swaps in the usual red, blue or white ID backgrounds, with reasonably clean hair edges.
Multi-size cropping: Crops to standard one- and two-inch ID sizes, with custom sizes and resolutions for different applications.
Auto print layout: Tiles the cropped photos onto a 6-inch print sheet automatically, ready to print without manual arranging.
CLI and GUI: A GUI for point-and-click use and a command line for batch processing, suitable for a small studio at volume.
LiYing automates that entire studio post-processing pipeline as an open-source program. Drop in a photo and it detects the face and body, corrects the tilt, cuts out the subject and swaps in a red, blue or white background, crops to the ID size you want, and even lays the results out for printing — filling a 6-inch sheet with multiple copies ready to take to a print shop.
The chain is: load image → detection and correction → background replacement → size adjustment → auto layout, none of it needing manual work. Handy for your own application photos, sorting out one- and two-inch photos for family, or a small studio doing volume.
Written in Python with both a CLI and a GUI, supporting custom sizes and background colours. AGPL, 3.3k stars.
Features
Face and body detection: Automatically finds the face and body in a loaded photo as the basis for cropping and layout, with no manual selection.
Automatic straightening: Detects a tilted subject and corrects it, so a crooked shot still yields an upright ID photo.
Cutout and background swap: Separates subject from background and swaps in the usual red, blue or white ID backgrounds, with reasonably clean hair edges.
Multi-size cropping: Crops to standard one- and two-inch ID sizes, with custom sizes and resolutions for different applications.
Auto print layout: Tiles the cropped photos onto a 6-inch print sheet automatically, ready to print without manual arranging.
CLI and GUI: A GUI for point-and-click use and a command line for batch processing, suitable for a small studio at volume.

