How PrintLilt calculates print size and crops

PrintLilt uses explicit geometry rather than a quality score. This page explains the relationships behind the displayed results and the limits that remain when an image becomes a physical print.

Units and defining dimensions

One international inch is exactly 25.4 mm, or 2.54 cm. Inch-defined photo sizes retain that definition during conversion. ISO paper entries use their stated millimetre dimensions; rounded inch displays do not replace those values.

A4 is 210 × 297 mm. Letter is 8.5 × 11 inches, or 215.9 × 279.4 mm. ISO B4 and B5 are labelled separately from the different JIS dimensions. Orientation swaps the two edges without creating another physical sheet entity.

Pixels, size, and PPI

Physical inches = pixels ÷ PPI. Conversely, PPI = pixels used ÷ physical inches. Apply the calculation to both edges of the same image rectangle. A uniform placement gives matching density in both directions, apart from raster rounding.

For 6000 × 4000 pixels at 300 PPI, the size is 20 × 13⅓ inches. The exact metric result is 50.8 × 33.8666… cm. For 3000 × 2000 pixels at 6 × 4 inches, both directions give 500 PPI.

PPI describes the image placement. Printer DPI describes the device’s dot resolution. Neither a high PPI number nor a changed resolution tag guarantees newly captured detail or a particular visual result.

Fill geometry

Let W and H be the oriented source pixel dimensions, and let r be the target width divided by target height. If W/H is greater than r, keep the full source height and use crop width H × r. Otherwise, keep the full source width and use crop height W ÷ r.

This produces the largest source rectangle with the target shape. Position moves that rectangle within the remaining source space. The width of the movable horizontal region is W minus crop width; the vertical region is H minus crop height.

For a 4000 × 3000 source and a 10 × 8 inch target, r is 1.25. The retained rectangle is 3750 × 3000 pixels, giving 375 PPI. A centred position removes 125 pixels from either side. Moving it changes the selected content, not the retained size.

Removed area

Removed area percentage = 100 × (1 − retained width × retained height ÷ (W × H)). This measures the fraction of the original image area excluded by the crop. It is not a judgment about the importance of that content.

In the 4000 × 3000 example, 3750 × 3000 pixels retain 93.75% of the source area, so 6.25% is removed. With the demonstration 6000 × 4000 source in the same 10 × 8 frame, fill retains 5000 × 4000 and removes about 16.67%.

Fit geometry and borders

For a target of width T and height U in one physical unit, the uniform scale is the smaller of T/W and U/H. The placed photo measures W × scale by H × scale. The unused width and height become borders inside the frame.

A 4000 × 3000 image kept whole in a 10 × 8 inch frame becomes 10 × 7.5 inches. Centring splits the remaining half inch of height into two quarter-inch borders. Effective PPI is 400, calculated from the photo rectangle rather than the surrounding frame.

Paper and repeated layouts

The usable rectangle is the sheet minus the chosen outer margins. A grid of C columns and R rows occupies C × frame width + (C − 1) × gap horizontally and R × frame height + (R − 1) × gap vertically. Both results must fit.

Two columns and two rows of 127 × 88.9 mm frames with 4 mm gaps occupy 258 × 181.8 mm. On landscape A4, centred outer margins are 19.5 mm horizontally and 14.1 mm vertically. The calculation does not infer a printer’s actual usable area.

Precision and raster rounding

Geometry can produce fractional pixel boundaries. Fill rounds the ideal crop inward to the largest whole-pixel rectangle, then rounds its origin within the available source space. Retained pixels and removed area use that actual integer crop. Displayed values are rounded for reading; the mathematical examples labelled ideal describe the continuous rectangle before this pixel step.

To preserve proportions, effective PPI is the larger of retained width divided by target width and retained height divided by target height. When inward rounding makes the ratio differ slightly, a tiny border remains rather than stretching the image. For example, the ideal 4000 × 2666⅔ crop becomes 4000 × 2666 pixels; at 6 × 4 inches it has about 666.67 PPI and a very small vertical border.

Photo-only export uses the retained pixel rectangle. Complete-frame export rounds each frame dimension times effective PPI upward to a whole pixel, then rounds the border offsets within the available space. Fit retains all source pixels. Check the downloaded dimensions when another application needs exact raster values.

The physical layout PDF uses the requested image and sheet measurements rather than the screen’s CSS pixel size. A summary PDF is a calculation report, not a physical photo placement.

Export and resource limits

The default raster output uses retained source pixels without automatic enlargement. A complete-frame option explicitly adds the chosen fit borders. PNG supports transparent or solid backgrounds; JPEG requires an opaque background. Standard canvas metadata may contain a default resolution label, which does not alter the effective PPI calculation.

Static JPEG, PNG, and WebP input must stay within 64 MiB, 40,000,000 decoded pixels, and 16,384 pixels on either edge. Animated PNG and WebP are excluded. Actual browser resource availability can be lower than these ceilings.

What the calculation does not predict

The preview is not a colour proof, a printer-specific simulation, or an on-screen physical ruler. It cannot determine focus quality, guarantee a lab’s crop handling, or certify passport or identity-photo compliance. Printer media support, margins, driver scaling, paper, and viewing conditions remain part of the real output process.

Use actual-size printing and a measured calibration mark to check physical scale. Preserve the original image so another composition is possible. The cited sources support dimensions, units, and browser behaviour; the worked numerical examples are independently calculated for PrintLilt.

Sources for this page