Screenshotly supports multiple output formats. Choose the one that best fits your use case.
| Format | Best for | Transparency | Compression |
|---|
| PNG | UI screenshots, pixel-perfect captures | Yes | Lossless |
| JPEG | Photos, large pages, smaller file sizes | No | Lossy |
| WebP | Web delivery, best size-to-quality ratio | Yes | Both |
| PDF | Printable documents | N/A | N/A |
const screenshot = await client.capture({
url: 'https://example.com',
format: 'webp'
});
The default format is png.
Quality settings
For JPEG, WebP, and PDF formats, use the image_quality parameter to control compression. The value is an integer between 0 and 100 (default: 80):
const screenshot = await client.capture({
url: 'https://example.com',
format: 'jpeg',
image_quality: 85
});
| Quality range | File size | Visual quality |
|---|
| 90–100 | Large | Highest fidelity |
| 70–89 | Medium | Good for most uses |
| 50–69 | Small | Noticeable artifacts |
| Below 50 | Smallest | Significant quality loss |
The image_quality parameter has no effect on PNG format since PNG uses lossless compression.
Transparent backgrounds
For PNG and WebP formats, use omit_background to remove the default white background:
curl -X POST https://api.screenshotly.dev/v1/capture \
-H "X-API-Key: $SCREENSHOTLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"options": {
"format": "png",
"omit_background": true
}
}' \
--output screenshot.png
PDF output
Screenshotly supports PDF output by setting format to pdf:
curl -X POST https://api.screenshotly.dev/v1/capture \
-H "X-API-Key: $SCREENSHOTLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"options": { "format": "pdf" }
}' \
--output page.pdf
- Use PNG when you need transparency or pixel-perfect accuracy
- Use JPEG at quality 75–85 for the best balance of size and quality
- Use WebP for web delivery where browser support is available
- Use PDF when you need a printable document format