> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.templated.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# File Size Limits and Optimization

# File Size Limits and Optimization

Understanding size limits and how to optimize your renders.

## Limits

### Input Limits
* **Image URLs**: No specific limit (but affects render time)
* **Request payload**: 10MB max
* **Template complexity**: No hard limit (performance may vary)

### Output Limits
* **Render file size**: Depends on dimensions and format
* **Video duration**: 90 seconds max
* **Scale factor**: 0.1 to 4.0

## Optimizing File Size

### Images

**Reduce dimensions:**
```json
{
  "width": 1080,   // Instead of 4K
  "height": 1080,
  "scale": 1.0
}
```

**Choose the right format:**
* **JPEG** — Smallest for photos
* **PNG** — Larger, but supports transparency
* **WebP** — Good balance of size/quality

### Videos

**Lower resolution:**
```json
{
  "width": 1280,
  "height": 720,  // 720p instead of 1080p
  "duration": 10000,
  "fps": 24       // 24 instead of 30/60
}
```

### PDFs

**Flatten layers:**
```json
{
  "format": "pdf",
  "flatten": true  // Reduces file size
}
```

## Performance Tips

### For Faster Renders

1. **Use smaller source images** — Match template dimensions
2. **Reduce template complexity** — Fewer layers = faster
3. **Optimize image URLs** — Use CDN-hosted images
4. **Use appropriate scale** — Don't over-scale

### For Smaller Files

1. **Use JPEG for photos** — 70-80% smaller than PNG
2. **Lower video FPS** — 24fps vs 60fps
3. **Reduce dimensions** — Render at actual needed size
4. **Flatten PDFs** — Especially for print

## Credit Impact

Larger/longer renders may cost more credits:
* Image renders: 1 credit regardless of size
* Video credits scale with: resolution × FPS × duration

## Troubleshooting Timeouts

If renders timeout:
1. Reduce template complexity
2. Use smaller source images
3. Lower output dimensions
4. Use async mode for videos