Screenshot Resolution, Device Pixel Ratio, and Shadow Rendering
Why high-density captures look sharper, how padding and aspect extension are calculated, and how canvas shadows and rounded clipping are drawn.
Primary Browser Tool
Screenshot Beautifier
Frame screenshots on gradient backgrounds with padding, rounded corners, drop shadow, and an optional browser window bar.
Device Pixel Ratio: Why Some Captures Have More Pixels
Screens report sizes in logical units, while the panel itself may have two or three physical pixels per unit in each direction. That factor is the device pixel ratio. A window 1200 units wide on a 2× display is captured as a 2400 px wide image.
Those extra pixels are what make text in a screenshot look smooth when it is displayed at its logical size. A capture from a 1× display has no such reserve, and enlarging it afterward cannot create one. This is why the 2× export option enlarges by interpolation: it helps when a slide or print layout needs more pixels, but it does not match a native high-density capture.
How the Canvas Is Sized
The layout is computed from the inside out, so the screenshot’s own pixels are never resampled at 1×.
- Window size = screenshot size, plus the title bar height if one is enabled.
- Padding = the chosen percentage of the screenshot width, added on all four sides.
- If a canvas shape is set, the canvas is widened or heightened until its ratio matches, and the window stays centered.
- If either side would exceed the browser’s 16384 px canvas limit, the whole layout is scaled down to fit.
| Input | Example | Result |
|---|---|---|
| Screenshot | 1600 × 900 px | Window 1600 × 954 px with a 54 px title bar |
| Padding 8% | 128 px per side | Canvas 1856 × 1210 px |
| Canvas shape 16:9 | Width extended | Canvas 2151 × 1210 px |
Shadows and Rounded Clipping
The shadow is produced by drawing a white rounded rectangle the size of the window with the canvas shadow settings enabled: a blur radius and a downward offset, both proportional to the window width so the look is the same at any resolution. The shape itself is then covered by the screenshot.
To round the screenshot’s corners, a rounded-rectangle path is set as a clipping region and the title bar and screenshot are drawn through it. Browsers anti-alias the clip edge, so corners are smooth. On a transparent background the shadow is stored as partially transparent pixels, which requires PNG or WebP; JPEG would flatten it onto white.
Practical Examples
Two captures of the same window
On a 1× monitor the capture is 1280 px wide; on a 2× laptop display it is 2560 px. Styled identically and shown at the same size on a web page, the second looks noticeably sharper.
Common Mistakes & Honest Limitations
Mistakes to Avoid
- Assuming 2× export is equivalent to capturing on a high-density display. It is an enlargement of existing pixels.
Technical Limitations
- Shadow softness is controlled by a single strength setting; separate blur, spread, and offset controls are not provided.