Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions examples/javascript/photoshop/photoshop.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,19 @@ async function generateAndRemoveBackground(prompt) {

console.log("Successfully generated the Firefly Image");

// Use Photoshop autoCutout api to perform operation on the generated image.
const psInput = {
href: firstImageUrl,
storage: StorageType.EXTERNAL
};

const psOutput = {
href: "<psOutputHref>", // Generate Pre-signed PUT URL to save the generated output file.
storage: "<psOutputStorage>" // example: StorageType.DROPBOX or StorageType.EXTERNAL or StorageType.AZURE
};

// Use Photoshop removeBackground v2 API to perform operation on the generated image.
const psRequestBody = {
input: psInput,
output: psOutput
image: {
source: {
url: firstImageUrl
}
},
mode: "cutout",
output: {
mediaType: "image/png"
},
trim: false,
colorDecontamination: 1
}

const removeBg = await photoshop.removeBackground(psRequestBody); // Remove Background
Expand Down
28 changes: 13 additions & 15 deletions examples/typescript/photoshop/photoshop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@

**************************************************************************/

import { PhotoshopClient, RemoveBackgroundRequest, SenseiOutputDetails } from "@adobe/photoshop-apis";
import { PhotoshopClient, RemoveBackgroundRequest } from "@adobe/photoshop-apis";
import { CoreTypes, FireflyClient, GenerateImagesResponse } from "@adobe/firefly-apis";
import { ServerToServerTokenProvider } from "@adobe/firefly-services-common-apis";
import { StorageDetails, StorageType } from "@adobe/lightroom-apis";

/**
* Function to generate an image and remove image background and save the file to the given output post pre-signed URL.
Expand Down Expand Up @@ -55,20 +54,19 @@ async function generateAndRemoveBackground(prompt: string) {

console.log("Successfully generated the Firefly Image");

// Use Photoshop autoCutout api to perform operation on the generated image.
const psInput: StorageDetails = {
href: firstImageUrl ?? "",
storage: StorageType.EXTERNAL,
};

const psOutput: SenseiOutputDetails = {
href: "<psOutputHref>", // Generate Pre-signed PUT URL to save the generated output file.
storage: StorageType.EXTERNAL, // example: StorageType.DROPBOX or StorageType.EXTERNAL or StorageType.AZURE
};

// Use Photoshop removeBackground v2 API to perform operation on the generated image.
const psRequestBody: RemoveBackgroundRequest = {
input: psInput,
output: psOutput,
image: {
source: {
url: firstImageUrl ?? ""
}
},
mode: "cutout",
output: {
mediaType: "image/png"
},
trim: false,
colorDecontamination: 1
};

const removeBg = await photoshop.removeBackground(psRequestBody); // Remove Background
Expand Down
21 changes: 21 additions & 0 deletions packages/photoshop/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
{
"name": "@adobe/photoshop-apis",
"entries": [
{
"version": "2.1.0",
"tag": "@adobe/photoshop-apis_v2.1.0",
"date": "Thu, 22 Jan 2026 19:37:53 GMT",
"comments": {
"minor": [
{
"comment": " - Updated removeBackground API to use v2 endpoint (/v2/remove-background)"
},
{
"comment": " - Removed deprecated `createMask` API"
},
{
"comment": " - Updated API documentation links to new structure"
},
{
"comment": " - Updated request/response types for v2 API compatibility"
}
]
}
},
{
"version": "2.0.1",
"tag": "@adobe/photoshop-apis_v2.0.1",
Expand Down
13 changes: 12 additions & 1 deletion packages/photoshop/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Change Log - @adobe/photoshop-apis

This log was last generated on Tue, 24 Jun 2025 10:13:05 GMT and should not be manually modified.
This log was last generated on Thu, 22 Jan 2026 19:37:53 GMT and should not be manually modified.

## 2.1.0
Thu, 22 Jan 2026 19:37:53 GMT

### Minor changes

- - Updated removeBackground API to use v2 endpoint (/v2/remove-background)
- - Removed deprecated `createMask` API
- - Updated API documentation links to new structure
- - Updated request/response types for v2 API compatibility


## 2.0.1
Tue, 24 Jun 2025 10:13:05 GMT
Expand Down
27 changes: 13 additions & 14 deletions packages/photoshop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@ Table below shows details on various API service endpoints and the corresponding

| Photoshop API Endpoint | SDK API Name | Description |
|:----------|:----------|:----------|
| [/pie/psdService/photoshopActions](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_actions/) |[playPhotoshopActions](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#playphotoshopactions) |Executes Photoshop Action file against a PSD, JPEG, PNG, or TIFF. |
| [/pie/psdService/actionJSON](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_actionJSON/) |[playPhotoshopActionsJson](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#playphotoshopactionsjson) |Execute a Photoshop Action with actionJSON format. |
[/sensei/cutout](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_removeBackground/) |[removeBackground](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#removebackground) |Isolate subject of interested in an image and remove background.  |
| [/pie/psdService/documentCreate](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_createPsd/) |[createDocument](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#createdocument) |Create new PSD with layers. |
| [/sensei/mask](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_createMask/) |[createMask](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#createmask) |Isolate a subject of interest in an image (people, objects, etc) and generate an image mask. |
| [/pie/psdService/renditionCreate](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_createRendition/) |[createRendition](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#createrendition) |Create flat image representations of a PSD in multiple formats. |
| [/pie/psdService/documentManifest](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_getManifest/) |[getDocumentManifest](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#getdocumentmanifest) |Extract metadata from PSD document, including general file and layer information. |
| [/pie/psdService/documentOperations](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_applyPsdEdits/) |[modifyDocument](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#modifydocument) |Apply basic layer edits (name, state, etc), add/edit adjustment, pixel, and shape layers.  |
| [/pie/psdService/smartObject](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_replaceSmartObject/) |[replaceSmartObject](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#replacesmartobject) |Replace Smart Object in a PSD. |
| [/pie/psdService/actionJsonCreate](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_createActionJson/) |[convertToActionsJson](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#converttoactionsjson) |Convert .atn file to an actionJSON format. |
| [/pie/psdService/artboardCreate](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_createArtboard/) |[createArtboard](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#createartboard) |Create artboards from multiple PSD inputs. |
| [/pie/psdService/depthBlur](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_depthBlur/) |[applyDepthBlur](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#applydepthblur) |Apply depth blur to an image input. |
| [/pie/psdService/productCrop](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_productCrop/) |[applyAutoCrop](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#applyautocrop) |Smart crop an image keeping the subject of interest in view. |
| [/pie/psdService/text](https://developer.adobe.com/firefly-services/docs/photoshop/api/photoshop_editText/) |[editTextLayer](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#edittextlayer) |Change the contents of a text layer in a PSD, eg for localization. |
| [/pie/psdService/photoshopActions](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/playPhotoshopActionsAsync) |[playPhotoshopActions](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#playphotoshopactions) |Executes Photoshop Action file against a PSD, JPEG, PNG, or TIFF. |
| [/pie/psdService/actionJSON](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/playPhotoshopActionsJsonAsync) |[playPhotoshopActionsJson](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#playphotoshopactionsjson) |Execute a Photoshop Action with actionJSON format. |
| [/v2/remove-background](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/removeBackground) |[removeBackground](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#removebackground) |Isolate subject of interested in an image and remove background. |
| [/pie/psdService/documentCreate](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/createDocumentAsync) |[createDocument](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#createdocument) |Create new PSD with layers. |
| [/pie/psdService/renditionCreate](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/createRenditionAsync) |[createRendition](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#createrendition) |Create flat image representations of a PSD in multiple formats. |
| [/pie/psdService/documentManifest](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/getDocumentManifestAsync) |[getDocumentManifest](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#getdocumentmanifest) |Extract metadata from PSD document, including general file and layer information. |
| [/pie/psdService/documentOperations](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/modifyDocumentAsync) |[modifyDocument](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#modifydocument) |Apply basic layer edits (name, state, etc), add/edit adjustment, pixel, and shape layers. |
| [/pie/psdService/smartObject](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/replaceSmartObjectAsync) |[replaceSmartObject](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#replacesmartobject) |Replace Smart Object in a PSD. |
| [/pie/psdService/actionJsonCreate](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/Photoshop/operation/actionJsonCreate) |[convertToActionsJson](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#converttoactionsjson) |Convert .atn file to an actionJSON format. |
| [/pie/psdService/artboardCreate](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/createArtboardAsync) |[createArtboard](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#createartboard) |Create artboards from multiple PSD inputs. |
| [/pie/psdService/depthBlur](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/applyDepthBlurAsync) |[applyDepthBlur](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#applydepthblur) |Apply depth blur to an image input. |
| [/pie/psdService/productCrop](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/applyAutoCropAsync) |[applyAutoCrop](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#applyautocrop) |Smart crop an image keeping the subject of interest in view. |
| [/pie/psdService/text](https://developer.adobe.com/firefly-services/docs/photoshop/api/#operation/editTextLayerAsync) |[editTextLayer](https://github.com/Firefly-Services/firefly-services-sdk-js/blob/main/docs/photoshop/classes/PhotoshopClient.md#edittextlayer) |Change the contents of a text layer in a PSD, eg for localization. |
2 changes: 1 addition & 1 deletion packages/photoshop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe/photoshop-apis",
"version": "2.0.1",
"version": "2.1.0",
"author": "Adobe",
"license": "Copyright (c) 2024 Adobe Inc",
"description": "Adobe Firefly Services library for consuming Photoshop Service APIs.",
Expand Down
20 changes: 1 addition & 19 deletions packages/photoshop/src/Photoshop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import type { ApplyDepthBlurRequest } from "./models/ApplyDepthBlurRequest";
import type { ConvertToActionsJsonRequest } from "./models/ConvertToActionsJsonRequest";
import type { CreateArtboardRequest } from "./models/CreateArtboardRequest";
import type { CreateDocumentRequest } from "./models/CreateDocumentRequest";
import type { CreateMaskRequest } from "./models/CreateMaskRequest";
import type { CreateRenditionRequest } from "./models/CreateRenditionRequest";
import type { DocumentManifestRequest } from "./models/DocumentManifestRequest";
import type { EditTextLayerRequest } from "./models/EditTextLayerRequest";
Expand Down Expand Up @@ -309,7 +308,7 @@ export class PhotoshopClient extends BaseServiceClient {
);
}
/**
* Remove Background API
* Remove Background API (v2)
* Isolate subject of interest in an image and remove background.
* @param requestBody The input image and the cutout mask parameters
* @param options Additional options to send any additional data or cancel the request
Expand All @@ -325,21 +324,4 @@ export class PhotoshopClient extends BaseServiceClient {
this._photoshopAsyncClient.senseiJobStatus
);
}
/**
* Create Mask API
* Isolate a subject of interest in an image (people, objects, etc) and generate an image mask
* @param requestBody The input image and the mask parameters
* @param options Additional options to send any additional data or cancel the request
* @returns SenseiJobApiResponse Job status
* @throws {ApiError}
*/
public async createMask(
requestBody: CreateMaskRequest,
options?: ApiOptions
): Promise<ApiResponse<SenseiJobApiResponse>> {
return new SenseiAsyncJob(
this._photoshopAsyncClient.createMaskAsync(requestBody, options),
this._photoshopAsyncClient.senseiJobStatus
);
}
}
33 changes: 2 additions & 31 deletions packages/photoshop/src/PhotoshopAsyncClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import type { ApplyDepthBlurRequest } from "./models/ApplyDepthBlurRequest";
import type { ConvertToActionsJsonRequest } from "./models/ConvertToActionsJsonRequest";
import type { CreateArtboardRequest } from "./models/CreateArtboardRequest";
import type { CreateDocumentRequest } from "./models/CreateDocumentRequest";
import type { CreateMaskRequest } from "./models/CreateMaskRequest";
import type { CreateRenditionRequest } from "./models/CreateRenditionRequest";
import type { DocumentManifestRequest } from "./models/DocumentManifestRequest";
import type { EditTextLayerRequest } from "./models/EditTextLayerRequest";
Expand Down Expand Up @@ -428,7 +427,7 @@ export class PhotoshopAsyncClient extends BaseServiceClient {
});
};
/**
* Remove Background API
* Remove Background API (v2)
* Isolate subject of interest in an image and remove background.
* @param requestBody The input image and the cutout mask parameters
* @param options Additional options to send any additional data or cancel the request
Expand All @@ -441,35 +440,7 @@ export class PhotoshopAsyncClient extends BaseServiceClient {
): Promise<ApiResponse<JobStatusLinkResponse>> {
return this._httpRequest.request({
method: "POST",
url: "/sensei/cutout",
body: requestBody,
mediaType: "application/json",
errors: {
400: `InputValidationError`,
402: `Trial Limit Exceeded Error`,
403: `Unauthorized`,
404: `Requested resource was not found`,
409: `Unable to upload asset`,
410: `Asset Link Invalid`
},
signal: options?.signal
});
}
/**
* Create Mask API
* Isolate a subject of interest in an image (people, objects, etc) and generate an image mask
* @param requestBody The input image and the mask parameters
* @param options Additional options to send any additional data or cancel the request
* @returns JobStatusLinkResponse response
* @throws {ApiError}
*/
public createMaskAsync(
requestBody: CreateMaskRequest,
options?: ApiOptions
): Promise<ApiResponse<JobStatusLinkResponse>> {
return this._httpRequest.request({
method: "POST",
url: "/sensei/mask",
url: "/v2/remove-background",
body: requestBody,
mediaType: "application/json",
errors: {
Expand Down
3 changes: 1 addition & 2 deletions packages/photoshop/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export { CompressionType } from "./models/CompressionType";
export type { ConvertToActionsJsonRequest } from "./models/ConvertToActionsJsonRequest";
export type { CreateArtboardRequest } from "./models/CreateArtboardRequest";
export type { CreateDocumentRequest } from "./models/CreateDocumentRequest";
export type { CreateMaskRequest } from "./models/CreateMaskRequest";
export type { CreateRenditionRequest } from "./models/CreateRenditionRequest";
export type { CropOptions } from "./models/CropOptions";
export type { DeleteDetails } from "./models/DeleteDetails";
Expand Down Expand Up @@ -118,7 +117,7 @@ export type { PlayPhotoshopActionsRequest } from "./models/PlayPhotoshopActionsR
export type { PsJobApiResponse } from "./models/PsJobApiResponse";
export type { PsJobResponse } from "./models/PsJobResponse";
export type { PsOutputDetails } from "./models/PsOutputDetails";
export type { RemoveBackgroundRequest } from "./models/RemoveBackgroundRequest";
export type { BackgroundColor, ImageSource, ImageInput, RemoveBackgroundOutput, RemoveBackgroundRequest } from "./models/RemoveBackgroundRequest";
export type { RenditionLinkDetails } from "./models/RenditionLinkDetails";
export type { RenditionLinks } from "./models/RenditionLinks";
export type { ReplaceSmartObjectRequest } from "./models/ReplaceSmartObjectRequest";
Expand Down
Loading