About ID Photo Size & Layout Tool
ID Photo Size & Layout Tool turns an ordinary portrait into a file that matches a document specification: a flat white, blue, red, or grey background, a crop to a millimetre size such as 35 × 45 mm, an export at the DPI you choose, and a printable sheet of copies. The single photo is a JPEG and the sheet a PNG, both tagged with the right print density, and the cutout model runs inside this browser tab.
Every ID photo specification is written in millimetres, because the document it lands on is physical. Pixels appear only once you pick a print density: mm ÷ 25.4 × DPI, so one 35 × 45 mm photo is 413 × 531 px at 300 DPI and 827 × 1063 px at 600. Rejections blamed on a tool are usually a source photo without enough pixels to fill the crop, a head at the wrong height in the frame, or a print that a driver scaled to fit the page.
How to use this developer tool
- Upload a JPEG, PNG, or WebP portrait, or switch to mixed layout first to load up to twelve files for one sheet.
- Run the cutout: the quick model loads faster, while the high-definition model adds a matting pass that resolves hair and thin spectacle frames.
- Pick the background — original, white, blue, red, or grey — and correct any halo with the professional tuning sliders: edge contract/expand, edge hardness, feather, and despill.
- In the crop step choose a preset or a custom millimetre size and set the DPI; the panel reports the resulting pixel size.
- Drag the photo in the crop frame, zoom between 100 % and 250 % to place the head, and download the single JPEG if that is enough.
- In the layout step set paper, orientation, margin, gap, and quantity, generate the sheet, then export the PNG or print at exactly 100 %.
Worked example: a 35 × 45 mm photo, then eight copies on a 4 × 6 in sheet
This is the whole arithmetic the tool performs: millimetres come from the specification, pixels follow from them and the DPI, and sheet capacity follows from the paper minus its margins.
Photo size 35 × 45 mm (Schengen / common international)
Export DPI 300
Background white
Paper 4 × 6 in = 152 × 102 mm, orientation auto
Paper margin 3 mm
Gap 2 mm
Quantity auto-fillSingle photo
width 35 / 25.4 x 300 = 413.39 -> 413 px
height 45 / 25.4 x 300 = 531.50 -> 531 px
413 x 531 px JPEG, tagged 300 DPI
Print sheet
paper 152 mm -> 1795 px, 102 mm -> 1205 px
usable 152 - 2 x 3 = 146 mm, 102 - 2 x 3 = 96 mm
columns floor((146 + 2) / (35 + 2)) = 4
rows floor((96 + 2) / (45 + 2)) = 2
8 photos on a 1795 x 1205 px PNG, tagged 300 DPIEach dimension rounds to a whole pixel, which at 300 DPI shifts a printed edge by under 0.05 mm. Source resolution matters more: the area inside the crop frame must already hold 413 × 531 px, which a phone photo does and a cropped screenshot rarely does.
Common ID photo sizes and their pixel dimensions at 300 DPI
The millimetre column is the specification; the pixel column is mm ÷ 25.4 × 300, rounded. A size missing from your locale's preset list can be entered as a custom 10–200 mm width and height.
| Specification | Millimetres | Pixels at 300 DPI | Used for |
|---|---|---|---|
| One inch (一寸) | 25 × 35 mm | 295 × 413 px | Chinese forms, student and staff cards |
| Two inch (二寸) | 35 × 49 mm | 413 × 579 px | Chinese résumés, professional titles |
| Small two inch / China passport | 33 × 48 mm | 390 × 567 px | Passport, exit-entry documents, visas |
| China resident ID card | 26 × 32 mm | 307 × 378 px | Second-generation identity card |
| US passport and visa | 51 × 51 mm (2 × 2 in) | 602 × 602 px | US passport, visa, green card |
| Schengen / EU / international | 35 × 45 mm | 413 × 531 px | EU and UK documents, India, Australia |
Troubleshooting
Hair strands are chopped off, or a thin spectacle frame disappears, after background replacement.
Why it happens The model works on a downscaled copy and returns a probability per pixel. Structures one or two pixels wide at that scale land in the uncertain middle and get pushed fully in or out.
Fix Switch to the high-definition model for its matting pass, expand the edge by a pixel or two, and add a little feather. Against a busy or dark background, reshooting on an even wall beats any tuning.
The face looks wrong in the crop: the nose is heavy and the ears nearly vanish.
Why it happens Perspective distortion from shooting too close, usually a selfie at arm's length. A short subject distance exaggerates whatever is nearest the lens, and it is already baked into the pixels.
Fix Reshoot from 1.5 to 2 metres using zoom. Cropping cannot undo it, and retouching facial features is exactly what most issuing authorities prohibit.
The photo was rejected for head size or position even though the millimetre size was right.
Why it happens Specifications constrain the head inside the frame, not only the frame. Schengen asks for roughly 32 to 36 mm from chin to crown within a 45 mm photo; the US asks for 1 to 1 3/8 inches within 2 inches.
Fix Convert the target to pixels first: at 300 DPI, 32 to 36 mm of head height is 378 to 425 px inside a 531 px frame. Measure the exported file against the authority's current band, which this tool does not enforce.
An upload form rejects the file for being too large or too small in kilobytes.
Why it happens Those limits are in bytes, independent of dimensions — tens of kilobytes on some Chinese portals, up to ten megabytes for the US State Department, which separately wants a square 600 × 600 to 1200 × 1200 px image.
Fix Change the DPI first: 600 down to 300 cuts the pixel count, and roughly the file size, to a quarter. If you need less again, re-encode once at a lower quality instead of re-saving the same JPEG.
The printed photo is a few millimetres off when you put a ruler on it.
Why it happens The print path resampled it. Fit to page, shrink to fit, and borderless all scale the image, and some photo-lab kiosks re-fit any file to their paper regardless of the density in its header.
Fix Print at exactly 100 % or actual size, select the paper that matches the sheet you generated, and turn page scaling off. Measure one photo before running a batch, and hand a lab the full sheet.
The required background is a specific shade that none of the swatches matches.
Why it happens The tool offers four fixed backgrounds — white, blue, red, and grey — covering the common cases. An authority that publishes an exact RGB value or one particular light blue will not be matched by a preset.
Fix Use the closest swatch only when the requirement is loose, such as plain white. When an exact value is published, composite the subject onto that colour in an image editor and verify with the authority's own checker.
When this tool is the right choice
- Producing a photo at a named millimetre specification with the pixel size and DPI a portal expects.
- Replacing an ordinary indoor background with a flat white, blue, red, or grey without a studio.
- Laying out a full sheet for 4 × 6 in, 5 × 7 in, or A4, including mixed sizes for several people.
- Handling a face photo without sending it to a service that keeps a copy.
When to use something else
- Embedding an image in CSS, HTML, or JSON. The Base64 Image tool converts a file to a data URI and back.
- Retouching. Skin smoothing, blemish removal, and clothing changes need a general image editor, and altering facial features is prohibited by most authorities.
- Confirming that a photo will be accepted. Only the issuing body can do that, and many publish an official checker to finish with.
Privacy and data handling
A face photo is personal data, and in many places a biometric identifier, so it deserves stricter handling than a log file. Your image is read into this browser tab and decoded to a canvas; the cutout, the crop, the sheet, and the export all run there, and it is never uploaded. The only network traffic is the one-time download of the model weights from public CDNs — a request for the model, not one carrying your photo. Nothing persists between visits.
Related developer tools
Frequently asked questions
Can I use this for a passport photo?
It prepares the file: the millimetre size, the pixel dimensions, the DPI, and a plain background. It cannot guarantee acceptance — requirements are set by the issuing authority and change, and a reviewer or an official checker decides on pose, expression, lighting, and head position.
Which background colour should I choose?
It depends on the document, not on preference. White is the safe default for passports, visas, and identity documents; blue is common for résumés, staff cards, and academic records; red appears on marriage certificates. Confirm the requirement before printing a sheet.
What DPI should I use?
Use 300 unless a specification says otherwise; it is the standard for photographic printing. 600 helps only when the cropped region genuinely holds that many pixels, otherwise you are upscaling and adding bytes without detail. Online-only forms read pixel dimensions and usually ignore the DPI tag.
Why does an upload form say my file is too large?
Those limits are in bytes, not millimetres. Lower the DPI first, since the pixel count falls with the square of the change, then re-encode once at a lower JPEG quality. Avoid re-saving the same JPEG repeatedly, as each pass adds artefacts around the hairline.
Can I print the sheet at home?
Yes. Export the PNG, load the paper size you selected, print at exactly 100 % with scaling off, then cut along the gaps. A 2 mm gap and a 3 mm margin leave room for the trimmer and for the drift most consumer printers have near the paper edge.
Are my photos uploaded anywhere?
No. The file is read into this tab and every step runs on your device. The only outbound requests fetch the cutout model weights, once, from public CDNs. Your image is not part of them and is not stored after you close the tab.
Can I put different sizes on one sheet?
Yes, that is what mixed layout mode is for. Load up to twelve photos, give each one its own preset or custom millimetre size and quantity, and the tool packs them row by row inside your margins. The capacity readout updates as you change paper, gap, or margin.