
Putting a pair of glasses on a face in a browser is not simply a matter of overlaying a transparent image. The frame must be oriented, scaled, and aligned in a way that responds to the user's face and camera movement.
SyntaxLab's virtual try-on demo begins by reading a front photo and, optionally, a photo of the size markings inside an arm. The backend extracts frame attributes and dimensions. If the source view is unsuitable, an image-editing step can create a cleaner, straight-on studio-style view. The browser then uses its try-on components to position a 3D frame.
Measure what is printed; label what is estimated
Eyewear often has dimensions printed on the arm, such as lens width, bridge width, and temple length. The demo instructs the vision model to read only legible printed values and return null when a value cannot be read. That is a helpful rule: unknown is better than a fabricated measurement.
When a marking is unavailable, a typical size may only be an estimate. A virtual preview cannot establish physical fit without calibrated rendering and user-specific measurements.
Normalize the product image
The frame needs a clear front-facing view for predictable positioning. Product photos taken at an angle, with a busy backdrop, or with the arms visible can be difficult to use as a 3D source. The demo checks for those conditions and can request a studio-style redraw.
Generative edits also need review: preserving shape, colour, hinges, and lens tint matters. An attractive output is not automatically an accurate product representation.
Treat the preview as visualization
Camera and landmark variation, screen scale, device placement, and frame geometry all affect perceived fit. A useful product should state that the preview is illustrative and let shoppers inspect dimensions and return policies before buying.
Project evidence
The backend parsing and image-edit workflow is in syntaxlab-backend/src/try-on.ts; the browser-side experience is in syntaxlab/src/components/demos/try-on/ and src/routes/demos.try-on.tsx. This is a prototype; no fitting accuracy, eyewear retailer integration, or conversion results are evidenced.