# Remove Background from Image — Adobe Photoshop

> Removes the background from an image using Adobe Photoshop API. See the documentation

- Key: `adobe_photoshop-remove-background-from-image`
- Type: Action (Write)
- Version: 0.0.3
- App: Adobe Photoshop (`adobe_photoshop`) — https://pipedream.com/apps/adobe-photoshop.md
- This page (HTML): https://pipedream.com/apps/adobe-photoshop/actions/remove-background-from-image
- Hints: destructive · open-world
- Source: https://github.com/PipedreamHQ/pipedream/blob/master/components/adobe_photoshop/actions/remove-background-from-image/remove-background-from-image.mjs

## Description

Removes the background from an image using Adobe Photoshop API. [See the documentation](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_removeBackground/)

## Props

| Prop | Type | Required | Description |
|---|---|---|---|
| `inputHref` | `string` | Yes | Any public url or a presignedURL for the asset input. |
| `inputStorage` | `string` | Yes | Asset stored on an external service (like AWS S3, Azure, Dropbox). |
| `optimize` | `string` | No | The value 'performance' optimizes for speed. 'batch' ensures the job will ultimately run regardless of wait time. |
| `outputHref` | `string` | Yes | Any public url or a presignedURL for the asset output. |
| `outputStorage` | `string` | Yes | Asset stored on an external service (like AWS S3, Azure, Dropbox). |
| `overwrite` | `boolean` | No | If the file already exists, indicates if the output file should be overwritten. Only applies to files stored in Adobe storage. |
| `maskFormat` | `string` | No | A soft (feathered) mask or binary mask. |

## Run it

**MCP**

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "adobe_photoshop",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
  name: "adobe_photoshop-remove-background-from-image",
  arguments: {
    inputHref: "Input Href",
    inputStorage: "Input Storage",
  },
})
```

**TypeScript**

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "adobe_photoshop-remove-background-from-image",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    adobe_photoshop: { authProvisionId: "apn_xxxxxxx" },
    inputHref: "Input Href",
    inputStorage: "Input Storage",
  },
})

console.log(result)
```

**cURL**

```bash
curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
  -H "Content-Type: application/json" \
  -H "X-PD-Environment: production" \
  -H "Authorization: Bearer {access_token}" \
  -d '{
    "external_user_id": "{external_user_id}",
    "id": "adobe_photoshop-remove-background-from-image",
    "configured_props": {
      "adobe_photoshop": { "authProvisionId": "apn_xxxxxxx" },
      "inputHref": "Input Href",
      "inputStorage": "Input Storage"
    }
  }'
```

---

- App: https://pipedream.com/apps/adobe-photoshop.md · All apps: https://pipedream.com/apps
