# Packshot Compositing

Composites a foreground image onto a background with configurable shadows, reflections, margins, and placement.

<Callout icon="📘" theme="info">
  ## Get Started with Image API

To use Jasper's Image endpoints, you'll need an API key. Image API access is available for customers on the Jasper Business plan with an API subscription.

**Already a Business customer?** Generate your API key in <Anchor label="Settings → API Tokens" target="_blank" href="https://app.jasper.ai/settings/dev-tools/tokens">Settings → API Tokens</Anchor>.

**New to Jasper?** [Request API access →](https://developers.jasper.ai/docs/request-image-api-access) </Callout>

<a label="LLM friendly version" href="https://developers.jasper.ai/reference/packshotcompositing.md">LLM friendly version</a>

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "paths": {
    "/v1/image/packshot-compositing": {
      "post": {
        "description": "Composites a foreground image onto a background with configurable shadows, reflections, margins, and placement.",
        "operationId": "packshotCompositing",
        "parameters": [],
        "requestBody": {
          "required": true,
          "description": "Foreground and background image upload, plus compositing options",
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "image_file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "background_image_file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "output_width": {
                    "type": "number",
                    "minimum": 64,
                    "maximum": 4096
                  },
                  "output_height": {
                    "type": "number",
                    "minimum": 64,
                    "maximum": 4096
                  },
                  "flip_horizontally": {
                    "type": "boolean",
                    "default": false
                  },
                  "shadow_type": {
                    "type": "string",
                    "enum": [
                      "behind_left",
                      "bottom_left",
                      "none"
                    ],
                    "default": "bottom_left"
                  },
                  "shadow_intensity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 1
                  },
                  "reflection_type": {
                    "type": "string",
                    "enum": [
                      "bottom",
                      "none"
                    ],
                    "default": "bottom"
                  },
                  "reflection_intensity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 1
                  },
                  "margin_left": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0.15
                  },
                  "margin_right": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0.15
                  },
                  "margin_top": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0.15
                  },
                  "margin_bottom": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0.15
                  },
                  "vertical_placement": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1,
                    "default": 0.5
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The packshot compositing was successful."
          },
          "400": {
            "description": "Bad request. May be missing required inputs or may have badly formatted inputs or options."
          },
          "500": {
            "description": "Internal server error. Unable to composite packshot."
          }
        },
        "security": [
          {
            "X-API-Key": []
          },
          {
            "oauth2": [
              "user"
            ]
          }
        ],
        "summary": "Packshot Compositing",
        "tags": [
          "Images"
        ]
      }
    }
  },
  "info": {
    "title": "Jasper API",
    "description": "Jasper API",
    "version": "1.0",
    "contact": {}
  },
  "servers": [
    {
      "url": "https://api.jasper.ai"
    }
  ],
  "components": {
    "securitySchemes": {
      "X-API-Key": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Workspace authentication using API key tokens in the X-API-Key header."
      },
      "oauth2": {
        "type": "oauth2",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://api.jasper.ai/oauth2/authorize",
            "tokenUrl": "https://api.jasper.ai/oauth2/token",
            "refreshUrl": "https://api.jasper.ai/oauth2/token",
            "scopes": {
              "user:read": "Read user information",
              "user": "Read and write user information"
            }
          }
        },
        "description": "User-level authentication using OAuth bearer tokens in the Authorization header."
      }
    }
  },
  "x-readme": {
    "metrics-enabled": false
  }
}
```