# Photoroom

> Edit product photos with Photoroom: remove or replace backgrounds, paint AI scenes, add shadows, fix lighting, remove text, upscale and resize pictures. Every picture is saved in Lodol.

App · 10 actions. Web page: https://docs.lodol.com/docs/integrations/photoroom

## Actions

### Add a shadow

Cut the subject out and add a realistic shadow under it.

**Inputs**

- Image (`image`, text, required): The picture: upload one, pick a file from an earlier step, or paste a public link to it. PNG, JPG and WebP work.
- Shadow style (`style`, text): How the shadow looks. One of: `ai.soft` (Soft (default)), `ai.hard` (Hard), `ai.floating` (Floating). Default: `ai.soft`.
- Background colour (`color`, text): A colour to put behind the subject, such as #FFFFFF or white. Leave blank to keep it transparent (a white one for JPG).
- File type (`output_format`, text): The file type of the new image. One of: `png` (PNG (default)), `jpg`, `webp`. Default: `png`.
- Save as (`filename`, text): The name to save the new image under. Leave blank to use the original name with a short ending. A name without an extension gets the right one.

**Outputs**

- `content_type` (text): MIME type of the new image
- `document_ref` (text): Reference to the new image, for use by a later step
- `documents` (list): The saved image, in the shape steps that send or upload files expect
- `filename` (text): Name the new image was saved under
- `sandbox` (true/false): True when the connected key is a sandbox (test) key, whose images are free and not meant for publishing
- `size_bytes` (number): Size of the new image in bytes
- `url` (text): Download URL for the new image

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
      "filename": "product-shadow.png",
      "size_bytes": 184233,
      "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "product-shadow.png",
  "sandbox": false,
  "size_bytes": 184233,
  "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
}
```

### Expand an image

Grow the canvas to a bigger size, such as a square photo to a wide banner, and have AI paint in the new edges.

**Inputs**

- Image (`image`, text, required): The picture: upload one, pick a file from an earlier step, or paste a public link to it. PNG, JPG and WebP work.
- Width (pixels) (`width`, number, required): The width of the new image in pixels. From 1 to 8000.
- Height (pixels) (`height`, number, required): The height of the new image in pixels. From 1 to 8000.
- File type (`output_format`, text): The file type of the new image. One of: `png` (PNG (default)), `jpg`, `webp`. Default: `png`.
- Save as (`filename`, text): The name to save the new image under. Leave blank to use the original name with a short ending. A name without an extension gets the right one.

**Outputs**

- `content_type` (text): MIME type of the new image
- `document_ref` (text): Reference to the new image, for use by a later step
- `documents` (list): The saved image, in the shape steps that send or upload files expect
- `filename` (text): Name the new image was saved under
- `sandbox` (true/false): True when the connected key is a sandbox (test) key, whose images are free and not meant for publishing
- `size_bytes` (number): Size of the new image in bytes
- `url` (text): Download URL for the new image

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
      "filename": "photo-expanded.png",
      "size_bytes": 184233,
      "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "photo-expanded.png",
  "sandbox": false,
  "size_bytes": 184233,
  "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
}
```

### Fix the lighting

Cut the subject out and relight it so it looks like it was shot in a studio.

**Inputs**

- Image (`image`, text, required): The picture: upload one, pick a file from an earlier step, or paste a public link to it. PNG, JPG and WebP work.
- Lighting (`mode`, text): How the subject is relit. One of: `ai.auto` (Automatic (default)), `ai.preserve-hue-and-saturation` (Keep the original colours). Default: `ai.auto`.
- Background colour (`color`, text): A colour to put behind the subject, such as #FFFFFF or white. Leave blank to keep it transparent (a white one for JPG).
- File type (`output_format`, text): The file type of the new image. One of: `png` (PNG (default)), `jpg`, `webp`. Default: `png`.
- Save as (`filename`, text): The name to save the new image under. Leave blank to use the original name with a short ending. A name without an extension gets the right one.

**Outputs**

- `content_type` (text): MIME type of the new image
- `document_ref` (text): Reference to the new image, for use by a later step
- `documents` (list): The saved image, in the shape steps that send or upload files expect
- `filename` (text): Name the new image was saved under
- `sandbox` (true/false): True when the connected key is a sandbox (test) key, whose images are free and not meant for publishing
- `size_bytes` (number): Size of the new image in bytes
- `url` (text): Download URL for the new image

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
      "filename": "product-relit.png",
      "size_bytes": 184233,
      "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "product-relit.png",
  "sandbox": false,
  "size_bytes": 184233,
  "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
}
```

### Generate a background

Describe a scene, such as 'a marble kitchen counter', and have AI paint it behind the subject. Each run gives a different scene.

**Inputs**

- Image (`image`, text, required): The picture: upload one, pick a file from an earlier step, or paste a public link to it. PNG, JPG and WebP work.
- Scene (`prompt`, text, required): What the background should look like.
- Leave out (`avoid`, text): Things the background must not contain, such as 'people, text'.
- File type (`output_format`, text): The file type of the new image. One of: `png` (PNG (default)), `jpg`, `webp`. Default: `png`.
- Save as (`filename`, text): The name to save the new image under. Leave blank to use the original name with a short ending. A name without an extension gets the right one.

**Outputs**

- `content_type` (text): MIME type of the new image
- `document_ref` (text): Reference to the new image, for use by a later step
- `documents` (list): The saved image, in the shape steps that send or upload files expect
- `filename` (text): Name the new image was saved under
- `sandbox` (true/false): True when the connected key is a sandbox (test) key, whose images are free and not meant for publishing
- `size_bytes` (number): Size of the new image in bytes
- `url` (text): Download URL for the new image

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
      "filename": "product-scene.png",
      "size_bytes": 184233,
      "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "product-scene.png",
  "sandbox": false,
  "size_bytes": 184233,
  "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
}
```

### Get account

Read how many images are left on the plan, so a workflow can stop before it runs out.

**Inputs**: None.

**Outputs**

- `available` (number): Images left to use in total
- `sandbox` (true/false): True when the connected key is a sandbox key
- `subscription` (number): Images left from the subscription

**Example output**

```json
{
  "available": 940,
  "sandbox": false,
  "subscription": 940
}
```

### Remove a background

Cut the subject out of a picture and save it with a transparent background.

**Inputs**

- Image (`image`, text, required): The picture: upload one, pick a file from an earlier step, or paste a public link to it. PNG, JPG and WebP work.
- Crop to the subject (`crop_to_subject`, true/false): Trim the empty space around the subject instead of keeping the original picture size. Default: `false`.
- File type (`output_format`, text): The file type of the cut-out. Both keep the transparent background. One of: `png` (PNG (default)), `webp`. Default: `png`.
- Save as (`filename`, text): The name to save the new image under. Leave blank to use the original name with a short ending. A name without an extension gets the right one.

**Outputs**

- `content_type` (text): MIME type of the new image
- `document_ref` (text): Reference to the new image, for use by a later step
- `documents` (list): The saved image, in the shape steps that send or upload files expect
- `filename` (text): Name the new image was saved under
- `sandbox` (true/false): True when the connected key is a sandbox (test) key, whose images are free and not meant for publishing
- `size_bytes` (number): Size of the new image in bytes
- `url` (text): Download URL for the new image

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
      "filename": "product-cutout.png",
      "size_bytes": 184233,
      "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "product-cutout.png",
  "sandbox": false,
  "size_bytes": 184233,
  "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
}
```

### Remove text

Erase text from a picture and fill in what was behind it. The background is kept.

**Inputs**

- Image (`image`, text, required): The picture: upload one, pick a file from an earlier step, or paste a public link to it. PNG, JPG and WebP work.
- Text to remove (`mode`, text): Which text to erase. One of: `ai.all` (All text (default)), `ai.artificial` (Added text only, such as overlays). Default: `ai.all`.
- File type (`output_format`, text): The file type of the new image. One of: `png` (PNG (default)), `jpg`, `webp`. Default: `png`.
- Save as (`filename`, text): The name to save the new image under. Leave blank to use the original name with a short ending. A name without an extension gets the right one.

**Outputs**

- `content_type` (text): MIME type of the new image
- `document_ref` (text): Reference to the new image, for use by a later step
- `documents` (list): The saved image, in the shape steps that send or upload files expect
- `filename` (text): Name the new image was saved under
- `sandbox` (true/false): True when the connected key is a sandbox (test) key, whose images are free and not meant for publishing
- `size_bytes` (number): Size of the new image in bytes
- `url` (text): Download URL for the new image

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
      "filename": "photo-no-text.png",
      "size_bytes": 184233,
      "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "photo-no-text.png",
  "sandbox": false,
  "size_bytes": 184233,
  "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
}
```

### Resize an image

Put a picture on a canvas of an exact size, for a shop listing or a social post. Can also remove the background.

**Inputs**

- Image (`image`, text, required): The picture: upload one, pick a file from an earlier step, or paste a public link to it. PNG, JPG and WebP work.
- Width (pixels) (`width`, number, required): The width of the new image in pixels. From 1 to 8000.
- Height (pixels) (`height`, number, required): The height of the new image in pixels. From 1 to 8000.
- Fit (`fit`, text): Whether the picture sits inside the size or fills it. One of: `fit` (Fit inside the size (default)), `fill` (Fill the size). Default: `fit`.
- Background colour (`color`, text): A colour to put behind the subject, such as #FFFFFF or white. Leave blank to keep it transparent (a white one for JPG).
- Remove the background (`remove_the_background`, true/false): Cut the subject out before placing it on the canvas. Default: `false`.
- File type (`output_format`, text): The file type of the new image. One of: `png` (PNG (default)), `jpg`, `webp`. Default: `png`.
- Save as (`filename`, text): The name to save the new image under. Leave blank to use the original name with a short ending. A name without an extension gets the right one.

**Outputs**

- `content_type` (text): MIME type of the new image
- `document_ref` (text): Reference to the new image, for use by a later step
- `documents` (list): The saved image, in the shape steps that send or upload files expect
- `filename` (text): Name the new image was saved under
- `sandbox` (true/false): True when the connected key is a sandbox (test) key, whose images are free and not meant for publishing
- `size_bytes` (number): Size of the new image in bytes
- `url` (text): Download URL for the new image

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
      "filename": "photo-1000x1000.png",
      "size_bytes": 184233,
      "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "photo-1000x1000.png",
  "sandbox": false,
  "size_bytes": 184233,
  "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
}
```

### Set the background colour

Cut the subject out and put a flat colour behind it, such as white for a shop listing.

**Inputs**

- Image (`image`, text, required): The picture: upload one, pick a file from an earlier step, or paste a public link to it. PNG, JPG and WebP work.
- Background colour (`color`, text, required): The colour behind the subject, such as #FFFFFF or white.
- Space around the subject (%) (`padding_percent`, number): How much empty space to leave around the subject, as a percentage of the picture, from 0 to 40. From 0 to 40.
- File type (`output_format`, text): The file type of the new image. One of: `png` (PNG (default)), `jpg`, `webp`. Default: `png`.
- Save as (`filename`, text): The name to save the new image under. Leave blank to use the original name with a short ending. A name without an extension gets the right one.

**Outputs**

- `content_type` (text): MIME type of the new image
- `document_ref` (text): Reference to the new image, for use by a later step
- `documents` (list): The saved image, in the shape steps that send or upload files expect
- `filename` (text): Name the new image was saved under
- `sandbox` (true/false): True when the connected key is a sandbox (test) key, whose images are free and not meant for publishing
- `size_bytes` (number): Size of the new image in bytes
- `url` (text): Download URL for the new image

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
      "filename": "product-background.png",
      "size_bytes": 184233,
      "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "product-background.png",
  "sandbox": false,
  "size_bytes": 184233,
  "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
}
```

### Upscale an image

Make a small or blurry picture larger and sharper with AI. The background is kept.

**Inputs**

- Image (`image`, text, required): The picture: upload one, pick a file from an earlier step, or paste a public link to it. PNG, JPG and WebP work.
- Quality (`quality`, text): Fast is good for most pictures; best quality takes longer. One of: `ai.fast` (Fast (default)), `ai.slow` (Best quality, slower). Default: `ai.fast`.
- File type (`output_format`, text): The file type of the new image. One of: `png` (PNG (default)), `jpg`, `webp`. Default: `png`.
- Save as (`filename`, text): The name to save the new image under. Leave blank to use the original name with a short ending. A name without an extension gets the right one.

**Outputs**

- `content_type` (text): MIME type of the new image
- `document_ref` (text): Reference to the new image, for use by a later step
- `documents` (list): The saved image, in the shape steps that send or upload files expect
- `filename` (text): Name the new image was saved under
- `sandbox` (true/false): True when the connected key is a sandbox (test) key, whose images are free and not meant for publishing
- `size_bytes` (number): Size of the new image in bytes
- `url` (text): Download URL for the new image

**Example output**

```json
{
  "content_type": "image/png",
  "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
  "documents": [
    {
      "content_type": "image/png",
      "document_ref": "doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91",
      "filename": "photo-upscaled.png",
      "size_bytes": 184233,
      "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
    }
  ],
  "filename": "photo-upscaled.png",
  "sandbox": false,
  "size_bytes": 184233,
  "url": "/actions/core/serve-document/doc_4b7c1e2a9d3f45c88a1e6f0b2d5c7e91?teamId=6512a1b2c3d4e5f600000001"
}
```
