Urgent.News

What's breaking now, across thousands of outlets.

Tech

How I built pixtidy's browser layout for six 2 2-inch green card photos on a 4 6 print

USCIS asks for two identical colour 2×2-inch photos. I built pixtidy's browser layout to fit six on one 4×6-inch print: an 1800×1200-pixel sheet at 300 dpi. Below, I explain the layout function and how to draw the sheet on a canvas for JPEG export. Print at actual size to preserve the dimensions. You can check your own photo against these rules for free in your browser on this page ; the photo is…

The process to create a 4x6-inch print containing six 2x2-inch photos involves several steps and requirements. First, the photos must meet specific criteria: they need to be 2x2 inches in size, printed on thin glossy paper with a white to off-white background, unmounted and unretouched, and taken against a white background. The head size is crucial, measuring from the top of the hair to the bottom of the chin, should be between 1 to 1⅜ inches.

Additionally, the eyes should be positioned 1⅛ to 1⅜ inches from the bottom of the photo. Each photo must have the same color, taken recently, and include a lightly printed name and A-Number on the back.

To fit six photos on a single 4x6-inch print, a layout function was developed. This function calculates the column and row count based on the sheet's width and height, photo dimensions, and a specified gap. For the given dimensions of 1800x1200 pixels for the sheet and 600x600 pixels for each photo with no gap, the layout function determines that three columns and two rows are needed to fit all six photos. The grid is centered on the sheet, and the positions for each photo are calculated, resulting in a specific layout.

The layout process involves creating an 1800x1200-pixel canvas, filling it with white, and then drawing each photo at its respective slot position. The positions are calculated as top-left coordinates for each photo, starting from (0,0) and incrementing based on the photo dimensions and any specified gap. In this case, the positions are (0,0), (600,0), (1200,0) for the first row, and (0,600), (600,600), (1200,600) for the second row.

After drawing the photos on the canvas, the sheet is exported as a JPEG. It's important to set the physical print size explicitly to ensure the correct dimensions. This involves printing the sheet at 6 inches wide by 4 inches high. The 1-pixel light-grey cut guides are added for design purposes but are not a requirement set by USCIS. To ensure the physical photo size, one can check that each printed photo measures 2x2 inches before use.

The layout function is flexible and can accommodate gaps between photos by adjusting the gap parameter. However, a zero-gap layout already occupies the entire sheet, so the function is tailored for this specific case. Before proceeding with the layout, it's essential to verify that the photos meet all the necessary requirements. These tools can be utilized on pixtidy's green card photo page for workflow purposes and on their photo requirements page to review all necessary specifications.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

"Compressing a PDF to a Target Size in the Browser", a developer write-up with code from the site's own compressor

an exact target file size (e.g., < 2 MB) using WebAssembly, PDF.js, and Canvas?In this write-up, we’ll explore how browser-based PDF compression works, why reaching a specific target size requires a…

  • JavaScript libraries like PDF.js and pdf-lib compress PDFs in browsers
  • Binary search algorithm adjusts image quality and scale for compression
  • Offloads tasks to Web Workers and cleans DOM to optimize performance

How I Built a Free Online Quiz Website

I recently started working on a small project called Unbotium, a free online quiz website. The idea was pretty simple: pick a subject, start a quiz, answer the questions before the timer runs out, and…

  • Created free online quiz website called Unbotium
  • Used AI tools like ChatGPT, Claude, and Grok in development
  • Website live at https://unbotium.com for exploration

More from Tuesday 6 October →