How to take a US visa photo with your phone
The geometry is the same square as the American passport photo: 2×2 inches, 50.8 mm a side, the head 25–35 mm from the chin to the crown and the eye line 28–35 mm up from the bottom edge. What changes is where the photo goes. Most applicants upload it inside the DS-160 form, where an automatic checker measures the file before a human ever looks at it, and that checker is the reason a photo that would sail through a print counter gets refused in a second.
Give it something easy to measure. Shoot about 1.5 metres from a plain white wall with the phone at your eye level on the rear camera, with daylight in front of you and nothing behind you — no door frame, no curtain, no shadow. Leave room around your head: the square crop comes later, and the uploader wants the face centred with the eyes at a specific height, which is much easier to hit from a loose original than from a photo already cut to size.
Why a US visa photo comes back
Glasses are not accepted. The rule has applied since November 2016 and there is no "no glare" version of it for US applications, so take them off completely; pushed up onto your hair, the frame still shows and the photo still fails.
The digital limits are the next obstacle: a square JPEG between 600×600 and 1200×1200 pixels and no larger than 240 KB. Squeeze a big photo under 240 KB with the wrong export settings and the compression blurs the face enough to fail the quality check. After that, the usual: a background that is not white or off-white, a photo older than six months, a smile with teeth rather than a neutral expression, a uniform, headphones, and a head covering worn for anything other than religious reasons.
Where a US visa photo is used
The upload belongs to the DS-160 non-immigrant application, and the printed 2×2 photo is what you take to the interview at the embassy or consulate when the upload fails or is not offered; immigrant visa and green-card paperwork uses the same square. Save both. The requirements in full are on the official State Department visa photo page.