DomShot supports three image formats. Choose based on your use case: lossless quality (PNG), smaller file size (JPEG/WebP), or modern web optimization (WebP).
| Format | Compression | Quality Parameter | Transparency | Best For |
|---|
| PNG | Lossless | No | Yes | Text, UI, documentation |
| JPEG | Lossy | Yes (1-100) | No | Photographs, complex images |
| WebP | Lossy | Yes (1-100) | Yes | Web applications, storage |
PNG
Lossless compression with perfect quality. Best for screenshots containing text, UI elements, or when you need transparency.
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&format=png" \
--output screenshot.png
Characteristics:
- Largest file size
- No quality loss
- Supports transparency
- Universal compatibility
JPEG
Lossy compression optimized for photographic content. Smaller files with adjustable quality.
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&format=jpeg&quality=80" \
--output screenshot.jpg
Characteristics:
- Smaller file size than PNG
- Adjustable quality (1-100, default: 100)
- No transparency support
- Best for photos and complex graphics
WebP
Modern format with excellent compression ratio. Ideal for web applications and storage optimization.
curl "https://api.domshot.com/shot?key=YOUR_API_KEY&url=https://example.com&format=webp&quality=80" \
--output screenshot.webp
Characteristics:
- Best compression ratio
- Adjustable quality (1-100, default: 100)
- Supports transparency
- Modern browser support
Quality parameter
The quality parameter controls compression for JPEG and WebP formats:
| Value | Description |
|---|
1-49 | Low quality, smallest files |
50-79 | Good balance of quality and size |
80-100 | High quality, larger files (default: 100) |
Quality settings do not apply to PNG format since it uses lossless compression.
Recommendations
Choose your format based on your primary need:
| Use case | Format | Reason |
|---|
| Documentation, tutorials | PNG | Sharp text, universal support |
| Social media thumbnails | JPEG | Small file size, wide compatibility |
| Web applications | WebP | Best compression, modern standard |
| Archiving | PNG | Lossless quality for long-term storage |
| Email attachments | JPEG | Smaller files, faster loading |
Parameters
| Parameter | Type | Default | Description |
|---|
format | string | png | png, jpeg, or webp |
quality | number | 100 | Image quality from 1-100 (JPEG/WebP only) |
See also