[{"data":1,"prerenderedAt":272},["ShallowReactive",2],{"current-page-en-cun-zhao":3},{"id":4,"title":5,"body":6,"card_image":90,"cover":67,"description":260,"extension":261,"featured":262,"layout":263,"meta":264,"navigation":262,"og_image":265,"path":266,"seo":267,"stem":268,"tags":269},"directory/en/dir/cun-zhao.md","寸照",{"type":7,"value":8,"toc":251},"minimal",[9,12,27,30,40,46,60,63,70,75,78,85,91,94,98,104,110,113,119,122,128,131,135,142,145,168,171,174,177,181,193,232,235,239,242,245,248],[10,11,5],"h1",{"id":5},[13,14,15,19,20],"p",{},[16,17,18],"strong",{},"Download the installer",": ",[21,22,26],"a",{"href":23,"rel":24},"https://pan.quark.cn/s/62cc6b4437b3",[25],"nofollow","Quark netdisk",[13,28,29],{},"You can also scan the mini program code below with WeChat to open 寸照 directly.",[13,31,33,34],{"align":32},"center","\n  ",[35,36],"img",{"src":37,"width":38,"alt":39},"/projects/cun-zhao/mini-program.jpg",360,"WeChat mini program code for Cun Zhao",[13,41,42],{"align":32},[43,44,45],"b",{},"Scan with WeChat to open the mini program",[13,47,48,49,54,55,59],{},"Applications, exams, and visas almost always ask for a digital ID photo. Plenty of websites can make one, but the picture has to be uploaded first. 寸照 is an offline desktop app based on the open source project ",[21,50,53],{"href":51,"rel":52},"https://github.com/Zeyi-Lin/HivisionIDPhotos",[25],"HivisionIDPhotos",". The current version is ",[56,57,58],"code",{},"0.1.0",".",[13,61,62],{},"After you pick a size and import a photo, matting, single-face checks, cropping, and background changes all happen locally. Export PNG or JPEG. It does not install Python, does not need a discrete GPU, and does not send network requests. The photo never leaves the computer.",[13,64,33,65],{"align":32},[35,66],{"src":67,"width":68,"alt":69},"/projects/cun-zhao/logo.png",128,"Cun Zhao logo",[71,72,74],"h2",{"id":73},"what-it-is-for","What it is for",[13,76,77],{},"The hard part of an ID photo is usually the specification, not taking the picture. One-inch and two-inch sizes are only the common cases. Exams, student records, social security cards, and visas each want different pixels, background colors, and file sizes.",[13,79,80,81,84],{},"寸照 keeps ",[16,82,83],{},"201"," common specifications in one list. Browse by category, or search by name and size.",[13,86,87],{},[35,88],{"alt":89,"src":90},"Home: pick a size, import a photo, or replace the background","/projects/cun-zhao/index-1.png",[13,92,93],{},"There are two screens: pick a specification, then review the result. No account, no orders, no camera capture, and no beauty filters or outfit changes. If an exam forbids retouching, follow the organizer's rules.",[71,95,97],{"id":96},"two-ways-to-use-it","Two ways to use it",[13,99,100,103],{},[16,101,102],{},"Import an ID photo",": detect the face, then crop to the specification frame. This fits turning a portrait into a standard photo. The output is a standard photo, a high-resolution photo, and a transparent background.",[13,105,106,109],{},[16,107,108],{},"Replace the background",": matte and recolor only, without cropping to the frame. This fits a photo that is already composed and just has the wrong background color.",[13,111,112],{},"The editor shows the specification and original image on the left, a preview in the middle, and background color plus export on the right. Colors can come from the specification or from a HEX value you enter. Recoloring only composites again; it does not rerun inference.",[13,114,115],{},[35,116],{"alt":117,"src":118},"Editor: preview, background color, and export","/projects/cun-zhao/index-2.png",[13,120,121],{},"Search by name, pixels, or millimeters, for example \"一寸\", \"295x413\", or \"教师\". The same name can have several entries, so check the notes and dimensions before you choose.",[13,123,124],{},[35,125],{"alt":126,"src":127},"Search specifications, for example teacher-certificate sizes","/projects/cun-zhao/index-3.png",[13,129,130],{},"Batch import is supported: select multiple files, or drop more PNG, JPEG, and WebP images onto the editor. Generation is serial. A photo with no face or too many faces is marked on its own and does not stop the rest.",[71,132,134],{"id":133},"how-it-works","How it works",[13,136,137,138,141],{},"The original HivisionIDPhotos pipeline is Python. This desktop app does not wrap Python. The ",[56,139,140],{},"hivision/creator/"," path is rewritten in Rust, aligned with the original algorithm. The interface is Tauri 2 and React.",[13,143,144],{},"Inference uses ONNX Runtime CPU (1.28):",[146,147,148,155],"ul",{},[149,150,151,154],"li",{},[16,152,153],{},"MODNet"," for matting, followed by hole filling and an alpha-guided filter to soften hair edges",[149,156,157,160,161,164,165],{},[16,158,159],{},"RetinaFace"," for face detection. There must be exactly one face, otherwise it reports ",[56,162,163],{},"NO_FACE"," or ",[56,166,167],{},"MULTI_FACE",[13,169,170],{},"IPC passes file paths only. On an M-series Mac, a roughly 576×768 image takes about 0.6 seconds end to end in a release build. A Windows machine without a discrete GPU usually produces a one-inch photo in 1 to 3 seconds.",[13,172,173],{},"When a specification sets a kilobyte limit, JPEG export starts at quality 95 and steps down until the file fits. PNG export writes the DPI.",[13,175,176],{},"Not included: a custom-size entry, GPU inference, beauty filters, rotation alignment, and print layout sheets.",[71,178,180],{"id":179},"download-and-install","Download and install",[13,182,183,184,187,188,59],{},"Source and notes are in the project repository. Download the installer from ",[21,185,26],{"href":23,"rel":186},[25],", or from ",[21,189,192],{"href":190,"rel":191},"https://github.com/yuanmomoya/cun-zhao-package/releases",[25],"cun-zhao-package Releases",[194,195,196,209],"table",{},[197,198,199],"thead",{},[200,201,202,206],"tr",{},[203,204,205],"th",{},"Platform",[203,207,208],{},"Notes",[210,211,212,224],"tbody",{},[200,213,214,218],{},[215,216,217],"td",{},"macOS 12+ (Apple Silicon)",[215,219,220,223],{},[56,221,222],{},".dmg",", unsigned. On first launch, right-click and choose Open",[200,225,226,229],{},[215,227,228],{},"Windows 10/11 x64",[215,230,231],{},"NSIS installer for the current user. If SmartScreen warns, choose Run anyway. WebView2 is required (Windows 11 usually includes it)",[13,233,234],{},"A 64-bit CPU, about 8GB of memory, and about 300MB of disk space are enough. No discrete GPU and no local Python install.",[71,236,238],{"id":237},"a-good-fit-and-a-poor-one","A good fit, and a poor one",[13,240,241],{},"A good fit: making one application photo on your own computer, changing the background, and exporting exact pixels without uploading the picture.",[13,243,244],{},"A poor fit: using it as a photo editor, running an ID photo studio, or applying to an exam that forbids any post-processing. The face needs to be clear, single, and front-facing.",[13,246,247],{},"The code is Apache-2.0. Face detection and matting stay local, and photos are not uploaded.",[13,249,250],{},"Development notes go on the WeChat account 程序员小袁.",{"title":252,"searchDepth":253,"depth":253,"links":254},"",2,[255,256,257,258,259],{"id":73,"depth":253,"text":74},{"id":96,"depth":253,"text":97},{"id":133,"depth":253,"text":134},{"id":179,"depth":253,"text":180},{"id":237,"depth":253,"text":238},"A fully offline desktop ID photo tool. Spec selection, cropping, background removal, and background color changes all stay on your computer.","md",true,"wide",{},null,"/en/dir/cun-zhao",{"title":5,"description":260},"en/dir/cun-zhao",[270,271],"Desktop","ID photo",1791702161548]