Customization
Fine-tune your OG images with customization options.
Output Options
Control the image output format and dimensions.
{
"template": "blog",
"data": { "title": "My Post" },
"options": {
"width": 1200,
"height": 630,
"format": "webp",
"quality": 85
}
}
Available Options
| Option | Type | Default | Range | Description |
|---|---|---|---|---|
width | number | 1200 | 200-2048 | Image width in pixels |
height | number | 630 | 200-2048 | Image height in pixels |
format | string | "png" | - | png, jpeg, webp |
quality | number | 90 | 1-100 | Compression quality |
Format Comparison
| Format | Best For | File Size | Quality |
|---|---|---|---|
| PNG | Graphics, text | Larger | Lossless |
| JPEG | Photos | Smaller | Lossy |
| WebP | Modern browsers | Smallest | Best ratio |
Performance Tip
Use WebP format for the smallest file sizes while maintaining quality.
Recommended Dimensions
Different platforms have different optimal sizes:
| Platform | Recommended Size |
|---|---|
| Twitter/X | 1200 x 630 |
| 1200 x 630 | |
| 1200 x 627 | |
| Discord | 1200 x 630 |
Caching
Generated images are cached for performance:
- Cache Duration: 24 hours by default
- Cache Key: Based on template + data hash
- Force Refresh: Add
cache: falseto options
{
"template": "blog",
"data": { "title": "Updated Title" },
"options": {
"cache": false
}
}
Best Practices
- Consistent Sizing - Use 1200x630 for broad compatibility
- Optimize Quality - 85-90 quality is usually sufficient
- Use WebP - When browser support allows
- Cache Wisely - Only disable cache when necessary