# Response Formats

> Choose the right image format for your use case — PNG for transparency, JPEG for smaller files, and WebP for the best of both.

- **URL**: https://orshot.com/docs/image-generation/response-formats

---

Orshot supports three image output formats. Set the format using the `response.format` field in your API request.

## Available Formats

| Format | Best For                                  | Transparency | File Size |
| :----- | :---------------------------------------- | :----------- | :-------- |
| `png`  | Social media, graphics with transparency  | Yes          | Larger    |
| `jpeg` | Photos, blog images, thumbnails           | No           | Smaller   |
| `webp` | Web content, performance-optimized images | Yes          | Smallest  |

## PNG (Default)

PNG is the default format. It supports transparency and produces sharp, lossless images — ideal for graphics, logos, and social media posts.```json
{
  "templateId": "<YOUR_TEMPLATE_ID>",
  "modifications": {
    "title": "Transparent Background Image"
  },
  "response": {
    "format": "png",
    "type": "url"
  }
}
```## JPEG

JPEG produces smaller files, which is useful for photo-heavy content like blog featured images or product photos. Transparency is not supported — transparent areas render as white.```json
{
  "templateId": "<YOUR_TEMPLATE_ID>",
  "modifications": {
    "photo": "https://example.com/product.jpg"
  },
  "response": {
    "format": "jpeg",
    "type": "url"
  }
}
```## WebP

WebP balances quality and file size. It supports transparency and typically produces files 25-35% smaller than PNG. Great for web applications where performance matters.```json
{
  "templateId": "<YOUR_TEMPLATE_ID>",
  "modifications": {
    "banner": "https://example.com/hero.jpg"
  },
  "response": {
    "format": "webp",
    "type": "url"
  }
}
```## Response Types

Regardless of the image format, you can choose how the image is delivered using `response.type`:

### URL (Default)

Returns a hosted URL that you can use directly in your application. The image is stored on Orshot's CDN.```json
{
  "response": {
    "format": "png",
    "type": "url"
  }
}
```Response:```json
{
  "data": {
    "content": "https://storage.orshot.com/cloud/renders/images/abc123.png"
  }
}
```### Base64

Returns the image as a Base64-encoded data URI. Useful when you need to embed the image directly, pass it to another service, or process it further.```json
{
  "response": {
    "format": "png",
    "type": "base64"
  }
}
```Response:```json
{
  "data": {
    "content": "data:image/png;base64,iVBORw0KGgo..."
  }
}
```### Binary

Returns the raw image binary data. Best for downloading the image directly or piping it to file storage.```json
{
  "response": {
    "format": "png",
    "type": "binary"
  }
}
```The response will be the raw image bytes with the appropriate `Content-Type` header.

## Controlling Output Size

Use `response.scale` to increase the output resolution without changing the template design:```json
{
  "response": {
    "format": "png",
    "type": "url",
    "scale": 2
  }
}
```A template designed at 1200×630px with `scale: 2` will output a 2400×1260px image.

## Custom Filenames

Use `response.fileName` to set a custom filename for the output. This is especially useful when generating images in bulk and organizing them by content.```json
{
  "response": {
    "format": "png",
    "type": "url",
    "fileName": "social-post-march-2026"
  }
}
```