Adobe Photoshop API Library
npm install @adobe/aio-lib-photoshop-api




The Rest API is documented at:
``bash`
$ npm install @adobe/aio-lib-photoshop-api
1) Initialize the SDK
`javascript
const sdk = require('@adobe/aio-lib-photoshop-api')
async function sdkTest() {
try {
//initialize sdk
const client = await sdk.init('
} catch (e) {
console.error(e)
}
}
`
2) Remove the background of a photo
This is the example of using the storage type of http://host/input.jpg (External) and call the service to cutout the background, ask for JPEG output, and store the result in Adobe Creative Cloud file storage path/output.jpg.
`javascript
const sdk = require('@adobe/aio-lib-photoshop-api')
async function sdkTest() {
try {
// initialize sdk
const client = await sdk.init('
// call methods
const result = await client.createCutout({
href: 'http://host/input.jpg',
storage: sdk.Storage.EXTERNAL
}, {
href: 'path/output.png',
storage: sdk.Storage.ADOBE,
type: sdk.MimeType.PNG
})
} catch (e) {
console.error(e)
}
}
`
1) Initialize the SDK with Adobe I/O Files access
Configuring the SDK like this will make plain paths reference locations in Adobe I/O Files.
`javascript
const libFiles = require('@adobe/aio-lib-files')
const sdk = require('@adobe/aio-lib-photoshop-api')
async function sdkTest() {
try {
// initialize sdk
const files = await libFiles.init();
const client = await sdk.init('
} catch (e) {
console.error(e)
}
}
`
2) Remove the background of a photo
This will automatically detect the storage type of http://host/input.jpg (e.g. Azure, External) and call the service to cutout the background, ask for JPEG output, and store the result in Adobe I/O Files under path/output.jpg.
`javascript
const libFiles = require('@adobe/aio-lib-files')
const sdk = require('@adobe/aio-lib-photoshop-api')
async function sdkTest() {
try {
// initialize sdk
const files = await libFiles.init();
const client = await sdk.init('
// call methods
// auto cutout...
const result = await client.createCutout('http://host/input.jpg', 'path/output.jpg')
console.log(result)
// equivalent call without FileResolver...
const result = await client.createCutout({
href: 'http://host/input.jpg',
storage: sdk.Storage.EXTERNAL
}, {
href: 'path/output.png',
storage: sdk.Storage.AIO,
type: sdk.MimeType.PNG
})
} catch (e) {
console.error(e)
}
}
`
Resolves the storage and mime type of files referenced in the API.
The storage type storage type is resolved for input and output files using the following heuristic:
Path resolution can be overridden by the defaultAdobeCloudPaths option.
The mime-type is resolved based on the extension of the pathname of the URL or the path. If no extension can
be found or the extension is unknown, the default image/png is selected.
This class provides methods to call your PhotoshopAPI APIs.
Before calling any method initialize the instance by calling the init method on it
with valid values for orgId, apiKey and accessToken
Abstraction around the Photoshop Services Jobs
booleanDetermine if we should retry fetch due to Server errors (server busy or other application errors)
functionFetch a URL, with retry options provided or default retry options otherwise
By default retries will happen for 14 seconds (3 retries at 1, 2 and then 4 seconds -- there cannot be enough time for anotehr retry after that)
Retry will occur if error code 429 or >= 500 occurs.
*Parse through options object and determine correct parameters to Swagger for desired fetch approach
Promise.<PhotoshopAPI>Returns a Promise that resolves with a new PhotoshopAPI object.
objectFile resolver options
objectPhotoshop API options
objectA reference to an input file
objectEither referencing a standard profile from StandardIccProfileNames in profileName, or a custom profile through input.
objectA reference to an output file, including output options
objectSet of edit parameters to apply to an image
objectLayer bounds (in pixels)
objectMask applied to an layer
objectLayer blend options
objectAdjustment layer brightness and contrast settings
objectAdjustment layer exposure settings
objectMaster channel hue and saturation settings
objectAdjustment layer hue and saturation settings
objectAdjustment layer color balance settings
objectAdjustment layer settings
objectFont color settings for RGB mode (16-bit)
objectFont color settings for CMYK mode (16-bit)
objectFont color settings for Gray mode (16-bit)
objectFont color settings
objectCharacter style settings
objectParagraph style
objectText layer settings
objectSmart object settings
objectFill layer settings
objectLayer reference
objectPosition where to add the layer in the layer hierarchy
objectPosition where to move the layer to in the layer hierarchy
objectLayer to add, replace, move or delete when manipulating a Photoshop document, or retrieved from the manifest
objectSmart object layer to add or replace
objectGlobal Photoshop document modification options
objectPhotoshop document create options
objectPhotoshop document manifest
objectReplace Smart Object options
objectReported job errors
objectJob status and output
The storage type storage type is resolved for input and output files using the following heuristic:
- If the storage type is provided, it is used as-is
- If a URL is provided, the hostname is inspected to determine Azure, Dropbox, or External (default)
- If a path is provided, the path resolved to Adobe I/O Files if an instance is provided to the constructor, otherwise it's Creative Cloud
Path resolution can be overridden by the defaultAdobeCloudPaths option.
The mime-type is resolved based on the extension of the pathname of the URL or the path. If no extension can
be found or the extension is unknown, the default image/png is selected.
Kind: global class
* FileResolver
* [new FileResolver([files], [options])](#new_FileResolver_new)
* .presignExpiryInSeconds : number
* .defaultPathStorage : Storage
* .resolveInput(input) ⇒ Input
* .resolveInputs(inputs) ⇒ Array.<Input>
* .resolveInputsDocumentOptions(options) ⇒ CreateDocumentOptions \| ModifyDocumentOptions \| ReplaceSmartObjectOptions
* .resolveInputsPhotoshopActionsOptions(options) ⇒ ApplyPhotoshopActionsOptions
* .resolveOutput(output) ⇒ Output
* .resolveOutputs(outputs) ⇒ Array.<Output>
| Param | Type | Description |
| --- | --- | --- |
| [files] | \* | Adobe I/O Files instance |
| [options] | FileResolverOptions | Options |
Kind: instance property of FileResolver
If an instance of files is provided, the default is considered to be
Adobe I/O Files, otherwise it's Creative Cloud. The default can be overridden
using the options
Kind: instance property of FileResolver
Kind: instance method of FileResolver
Returns: Input - resolved input
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | Input or href to resolve |
Kind: instance method of FileResolver
Returns: Array.<Input> - resolved files
| Param | Type | Description |
| --- | --- | --- |
| inputs | string \| Array.<string> \| Input \| Array.<Input> | One or more files |
Kind: instance method of FileResolver
Returns: CreateDocumentOptions \| ModifyDocumentOptions \| ReplaceSmartObjectOptions - Document options
| Param | Type | Description |
| --- | --- | --- |
| options | CreateDocumentOptions \| ModifyDocumentOptions \| ReplaceSmartObjectOptions | Document options |
Kind: instance method of FileResolver
Returns: ApplyPhotoshopActionsOptions - Photoshop Actions options
| Param | Type | Description |
| --- | --- | --- |
| options | ApplyPhotoshopActionsOptions | Photoshop Actions options |
Kind: instance method of FileResolver
Returns: Output - resolved files
| Param | Type | Description |
| --- | --- | --- |
| output | string \| File \| Output | One or more output files |
Kind: instance method of FileResolver
Returns: Array.<Output> - resolved files
| Param | Type | Description |
| --- | --- | --- |
| outputs | string \| Array.<string> \| File \| Array.<File> \| Output \| Array.<Output> | One or more output files |
method on it
with valid values for orgId, apiKey and accessTokenKind: global class
* PhotoshopAPI
* .orgId : string
* .apiKey : string
* .accessToken : string
* [.init(orgId, apiKey, accessToken, [files], [options])](#PhotoshopAPI+init) ⇒ Promise.<PhotoshopAPI>
* .createCutout(input, output) ⇒ Job
* .createMask(input, output) ⇒ Job
* .straighten(input, outputs) ⇒ Job
* .autoTone(input, output) ⇒ Job
* .editPhoto(input, output, options) ⇒ Job
* .applyPreset(input, preset, output) ⇒ Job
* .applyPresetXmp(input, output, xmp) ⇒ Job
* .createDocument(outputs, options) ⇒ Job
* [.getDocumentManifest(input, [options])](#PhotoshopAPI+getDocumentManifest) ⇒ Job
* .modifyDocument(input, outputs, options) ⇒ Job
* .createRendition(input, outputs) ⇒ Job
* .replaceSmartObject(input, outputs, options) ⇒ Job
* .applyPhotoshopActions(input, outputs, options) ⇒ Job
* .applyPhotoshopActionsJson(input, outputs, options) ⇒ Job
$3
The IMS organization idKind: instance property of PhotoshopAPI
$3
The api key from your integrationKind: instance property of PhotoshopAPI
$3
The access token from your integrationKind: instance property of PhotoshopAPI
$3
Initializes the PhotoshopAPI object and returns it.Kind: instance method of PhotoshopAPI
Returns: Promise.<PhotoshopAPI> - a PhotoshopAPI object
| Param | Type | Description |
| --- | --- | --- |
| orgId | string | the IMS organization id |
| apiKey | string | the API key for your integration |
| accessToken | string | the access token for your integration |
| [files] | \* | Adobe I/O Files instance |
| [options] | PhotoshopAPIOptions | Options |
$3
Create a cutout mask, and apply it to the inputKind: instance method of PhotoshopAPI
Returns: Job - Auto cutout job
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | Input file |
| output | string \| Output | Output file |
$3
Create a cutout maskKind: instance method of PhotoshopAPI
Returns: Job - Auto masking job
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | Input file |
| output | string \| Output | Output file |
$3
Straighten photoKind: instance method of PhotoshopAPI
Returns: Job - Auto straighten job
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | Input file |
| outputs | string \| Output \| Array.<Output> | Output file |
$3
Automatically tone photoKind: instance method of PhotoshopAPI
Returns: Job - Auto tone job
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | Input file |
| output | string \| Output | Output file |
$3
Apply a set of edit parameters on an imageKind: instance method of PhotoshopAPI
Returns: Job - Edit photo job
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | Input file |
| output | string \| Output | Output file |
| options | EditPhotoOptions | Edit options |
$3
Apply a preset on an imageKind: instance method of PhotoshopAPI
Returns: Job - Apply preset job
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | Input file |
| preset | string \| Input | Lightroom preset XMP file |
| output | string \| Output | Output file |
$3
Apply a preset on an imageKind: instance method of PhotoshopAPI
Returns: Job - Apply preset job
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | Input file |
| output | string \| Output | Output file |
| xmp | string | Lightroom preset XMP file contents |
$3
Create a new psd, optionally with layers, and then generate renditions and/or save as a psdKind: instance method of PhotoshopAPI
Returns: Job - Create document job
| Param | Type | Description |
| --- | --- | --- |
| outputs | string \| Array.<string> \| Output \| Array.<Output> | Desired output |
| options | CreateDocumentOptions | Document create options |
$3
Extract and return a psd file's layer informationKind: instance method of PhotoshopAPI
Returns: Job - Get document manifest job
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | An object describing an input PSD file.Current support is for files less than 1000MB. |
| [options] | object | available options to apply to all input files |
| [options.thumbnails] | object | Include presigned GET URLs to small preview thumbnails for any renderable layer. |
| [options.thumbnails.type] | MimeType | desired image format. Allowed values: "image/jpeg", "image/png", "image/tiff" |
$3
Apply (optional) psd edits and then generate renditions and/or save a new psdKind: instance method of PhotoshopAPI
Returns: Job - Modify document job
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | An object describing an input PSD file. Current support is for files less than 1000MB. |
| outputs | string \| Array.<string> \| Output \| Array.<Output> | Desired output |
| options | ModifyDocumentOptions | Modify document options |
$3
Create renditionsKind: instance method of PhotoshopAPI
Returns: Job - Create rendition job
| Param | Type | Description |
| --- | --- | --- |
| input | string \| Input | An object describing an input file. Currently supported filetypes include: jpeg, png, psd, tiff. Current support is for files less than 1000MB. |
| outputs | string \| Array.<string> \| Output \| Array.<Output> | Desired output |
$3
Apply psd edits for replacing embedded smart object and then generate renditions and/or save a new psdKind: instance method of PhotoshopAPI
Returns: Job - Replace smart object job
| Param | Type | Description |
| --- | --- | --- |
| input | Input | An object describing an input PSD file. Current support is for files less than 1000MB. |
| outputs | string \| Output \| Array.<Output> | Desired output |
| options | ReplaceSmartObjectOptions | Replace smart object options |
$3
Apply Photoshop Actions and then generate renditions and/or save a new imageKind: instance method of PhotoshopAPI
Returns: Job - Photoshop Actions job
| Param | Type | Description |
| --- | --- | --- |
| input | Input | An object describing an input image file. Current support is for files less than 1000MB. |
| outputs | string \| Output \| Array.<Output> | Desired output |
| options | ApplyPhotoshopActionsOptions | Apply Photoshop Actions options |
$3
Apply JSON-formatted Photoshop Actions and then generate renditions and/or save a new imageKind: instance method of PhotoshopAPI
Returns: Job - Photoshop Actions job
| Param | Type | Description |
| --- | --- | --- |
| input | Input | An object describing an input image file. Current support is for files less than 1000MB. |
| outputs | string \| Output \| Array.<Output> | Desired output |
| options | ApplyPhotoshopActionsJsonOptions | Apply Photoshop Actions JSON options |
Job
Abstraction around the Photoshop Services JobsKind: global class
* Job
* new Job(response, getJobStatus)
* .url : string
* .jobId : string
* .outputs : Array.<JobOutput>
* .isDone() ⇒ boolean
* .poll() ⇒ Job
* [.pollUntilDone([pollTimeMs])](#Job+pollUntilDone) ⇒ Job
$3
Construct a job with the ability to acquire status updates
| Param | Type | Description |
| --- | --- | --- |
| response | \* | Service response |
| getJobStatus | function | Async function to get job status |
$3
URL to request a status update of the jobKind: instance property of Job
$3
Job identifierKind: instance property of Job
$3
Status of each output sub jobKind: instance property of Job
$3
Check if the job is doneA job is marked done when it has either the
succeeded or failed status.Kind: instance method of Job
Returns: boolean - True if the job is done, or false if it is still pending/running
$3
Poll for job statusKind: instance method of Job
Returns: Job - Job instance
$3
Poll job until doneKind: instance method of Job
Returns: Job - Job instance
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| [pollTimeMs] | number | 2000 | Polling time |
Storage
Storage typesKind: global enum
Read only: true
Properties
| Name | Default | Description |
| --- | --- | --- |
| AIO | aio | href is a path in Adobe I/O Files: https://github.com/adobe/aio-lib-files |
| ADOBE | adobe | href is a path in Creative Cloud |
| EXTERNAL | external | href is a presigned get/put url, e.g. AWS S3 |
| AZURE | azure | href is an Azure SAS (Shared Access Signature) URL for upload/download |
| DROPBOX | dropbox | href is a temporary upload/download Dropbox link: https://dropbox.github.io/dropbox-api-v2-explorer/ |
MimeType
Mime typesKind: global enum
Read only: true
Properties
| Name | Default | Description |
| --- | --- | --- |
| DNG | image/x-adobe-dng | Digital Negative, available from
autoTone, straighten, applyPreset |
| JPEG | image/jpeg | JPEG, available from all operations |
| PNG | image/png | PNG, available from all operations |
| PSD | image/vnd.adobe.photoshop | Photoshop Document, available from createDocument, modifyDocument, createRendition, replaceSmartObject |
| TIFF | image/tiff | TIFF format, available from createDocument, modifyDocument, createRendition, replaceSmartObject |PngCompression
Compression level for PNG: small, medium or large.Kind: global enum
Read only: true
Properties
| Name | Default |
| --- | --- |
| SMALL | small |
| MEDIUM | medium |
| LARGE | large |
Colorspace
Color spaceKind: global enum
Read only: true
Properties
| Name | Default |
| --- | --- |
| BITMAP | bitmap |
| GREYSCALE | greyscale |
| INDEXED | indexed |
| RGB | rgb |
| CMYK | cmyk |
| MULTICHANNEL | multichannel |
| DUOTONE | duotone |
| LAB | lab |
StandardIccProfileNames
Standard ICC profile namesKind: global enum
Read only: true
Properties
| Name | Default |
| --- | --- |
| ADOBE_RGB_1998 | Adobe RGB (1998) |
| APPLE_RGB | Apple RGB |
| COLORMATCH_RGB | ColorMatch RGB |
| SRGB | sRGB IEC61966-2.1 |
| DOTGAIN_10 | Dot Gain 10% |
| DOTGAIN_15 | Dot Gain 15% |
| DOTGAIN_20 | Dot Gain 20% |
| DOTGAIN_25 | Dot Gain 25% |
| DOTGAIN_30 | Dot Gain 30% |
| GRAY_GAMMA_18 | Gray Gamma 1.8 |
| GRAY_GAMMA_22 | Gray Gamma 2.2 |
CreateMaskType
Type of mask to createKind: global enum
Read only: true
Properties
| Name | Default | Description |
| --- | --- | --- |
| BINARY | binary | Binary mask |
| SOFT | soft | Soft mask |
WhiteBalance
White balance enumKind: global enum
Read only: true
Properties
| Name | Default |
| --- | --- |
| AS_SHOT | As Shot |
| AUTO | Auto |
| CLOUDY | Cloudy |
| CUSTOM | Custom |
| DAYLIGHT | Daylight |
| FLASH | Flash |
| FLUORESCENT | Fluorescent |
| SHADE | Shade |
| TUNGSTEN | Tungsten |
ManageMissingFonts
Action to take if there are one or more missing fonts in the documentKind: global enum
Read only: true
Properties
| Name | Default | Description |
| --- | --- | --- |
| USE_DEFAULT | useDefault | The job will succeed, however, by default all the missing fonts will be replaced with this font: ArialMT |
| FAIL | fail | The job will not succeed and the status will be set to "failed", with the details of the error provided in the "details" section in the status |
BackgroundFill
Background fillKind: global enum
Read only: true
Properties
| Name | Default |
| --- | --- |
| WHITE | white |
| BACKGROUND_COLOR | backgroundColor |
| TRANSPARENT | transparent |
LayerType
Layer typeKind: global enum
Read only: true
Properties
| Name | Default | Description |
| --- | --- | --- |
| LAYER | layer | A pixel layer |
| TEXT_LAYER | textLayer | A text layer |
| ADJUSTMENT_LAYER | adjustmentLayer | An adjustment layer |
| LAYER_SECTION | layerSection | Group of layers |
| SMART_OBJECT | smartObject | A smart object |
| BACKGROUND_LAYER | backgroundLayer | The background layer |
| FILL_LAYER | fillLayer | A fill layer |
BlendMode
Blend modesKind: global enum
Read only: true
Properties
| Name | Default |
| --- | --- |
| NORMAL | normal |
| DISSOLVE | dissolve |
| DARKEN | darken |
| MULTIPLY | multiply |
| COLOR_BURN | colorBurn |
| LINEAR_BURN | linearBurn |
| DARKER_COLOR | darkerColor |
| LIGHTEN | lighten |
| SCREEN | screen |
| COLOR_DODGE | colorDodge |
| LINEAR_DODGE | linearDodge |
| LIGHTER_COLOR | lighterColor |
| OVERLAY | overlay |
| SOFT_LIGHT | softLight |
| HARD_LIGHT | hardLight |
| VIVID_LIGHT | vividLight |
| LINEAR_LIGHT | linearLight |
| PIN_LIGHT | pinLight |
| HARD_MIX | hardMix |
| DIFFERENCE | difference |
| EXCLUSION | exclusion |
| SUBTRACT | subtract |
| DIVIDE | divide |
| HUE | hue |
| SATURATION | saturation |
| COLOR | color |
| LUMINOSITY | luminosity |
TextOrientation
Text orientationKind: global enum
Read only: true
Properties
| Name | Default |
| --- | --- |
| HORIZONTAL | horizontal |
| VERTICAL | vertical |
ParagraphAlignment
Paragraph alignmentKind: global enum
Read only: true
Properties
| Name | Default |
| --- | --- |
| LEFT | left |
| CENTER | center |
| RIGHT | right |
| JUSTIFY | justify |
| JUSTIFY_LEFT | justifyLeft |
| JUSTIFY_CENTER | justifyCenter |
| JUSTIFY_RIGHT | justifyRight |
HorizontalAlignment
Horizontal alignmentKind: global enum
Read only: true
Properties
| Name | Default |
| --- | --- |
| LEFT | left |
| CENTER | center |
| RIGHT | right |
VerticalAlignment
Vertical alignmentKind: global enum
Read only: true
Properties
| Name | Default |
| --- | --- |
| TOP | top |
| CENTER | center |
| BOTTOM | bottom |
JobOutputStatus
Output statusKind: global enum
Read only: true
Properties
| Name | Default | Description |
| --- | --- | --- |
| PENDING | pending | request has been accepted and is waiting to start |
| RUNNING | running | the child job is running |
| UPLOADING | uploading | files have been generated and are uploading to destination |
| SUCCEEDED | succeeded | the child job has succeeded |
| FAILED | failed | the child job has failed |
shouldRetryFetch(response) ⇒ boolean
Determine if we should retry fetch due to Server errors (server busy or other application errors)Kind: global function
Returns: boolean - true if we should retry or false if not
| Param | Type | Description |
| --- | --- | --- |
| response | \* | Fetch response object, should at least have a status property which is the HTTP status code received |
nodeFetchRetry(options) ⇒ function
Fetch a URL, with retry options provided or default retry options otherwise
By default retries will happen for 14 seconds (3 retries at 1, 2 and then 4 seconds -- there cannot be enough time for anotehr retry after that)
Retry will occur if error code 429 or >= 500 occurs.Kind: global function
Returns: function - Wrapped node fetch retry function which takes our preferred default options
| Param | Type | Description |
| --- | --- | --- |
| options | \* | Fetch options object, which can also include retryOptions described here https://github.com/adobe/node-fetch-retry |
getFetchOptions(options) ⇒ \*
Parse through options object and determine correct parameters to Swagger for desired fetch approachKind: global function
Returns: \* - Swagger options object with relevant settings for fetch module
| Param | Type | Description |
| --- | --- | --- |
| options | \* | Photoshop API options object |
init(orgId, apiKey, accessToken, [files], [options]) ⇒ Promise.<PhotoshopAPI>
Returns a Promise that resolves with a new PhotoshopAPI object.Kind: global function
Returns: Promise.<PhotoshopAPI> - a Promise with a PhotoshopAPI object
| Param | Type | Description |
| --- | --- | --- |
| orgId | string | IMS organization id |
| apiKey | string | the API key for your integration |
| accessToken | string | the access token for your integration |
| [files] | \* | Adobe I/O Files instance |
| [options] | PhotoshopAPIOptions | Options |
FileResolverOptions : object
File resolver optionsKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [presignExpiryInSeconds] | number | 3600 | Expiry time of any presigned urls, defaults to 1 hour |
| [defaultAdobeCloudPaths] | boolean | | True if paths should be considered references to files in Creative Cloud |
PhotoshopAPIOptions : object
Photoshop API optionsKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [presignExpiryInSeconds] | number | 3600 | Expiry time of any presigned urls, defaults to 1 hour |
| [defaultAdobeCloudPaths] | boolean | | True if paths should be considered references to files in Creative Cloud |
| [useSwaggerFetch] | boolean | false | True if Swagger's fetch implementation should be used, otherwise will use userFetch if provided or @adobe/node-fetch-retry if nothing else. |
| [userFetch] | function | | Fetch function to use replacing Swagger's fetch and node-fetch-retry. Useful for mocking, etc |
Input : object
A reference to an input fileKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| href | string | Either an href to a single Creative Cloud asset for storage='adobe' OR a presigned GET URL for other external services. |
| [storage] | Storage | Storage type, by default detected based on
href |IccProfile : object
Either referencing a standard profile from StandardIccProfileNames in profileName, or a custom profile through input.Kind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| imageMode | Colorspace | Image mode |
| input | Input | Custom ICC profile href to a Creative Cloud asset or presigned URL |
| profileName | string | Standard ICC profile name (e.g.
Adobe RGB (1998)) |Output : object
A reference to an output file, including output optionsKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| href | string | | (all) Either an href to a single Creative Cloud asset for storage='adobe' OR a presigned GET URL for other external services. |
| [storage] | Storage | | (all) Storage type, by default detected based on
href |
| [type] | MimeType | | (all) Desired output image format, by default detected based on href` extension |boolean | true | (all) If the file already exists, indicates if the output file should be overwritten. Will eventually support eTags. Only applies to CC Storage |object | | (createMask, createCutout) Type of mask to create |CreateMaskType | | (createMask, createCutout) Binary or soft mask to create |number | 0 | (document) width, in pixels, of the renditions. Width of 0 generates a full size rendition. Height is not necessary as the rendition generate will automatically figure out the correct width-to-height aspect ratio. Only supported for image renditions |number | 7 | (document) quality of the renditions for JPEG. Range from 1 to 7, with 7 as the highest quality. |PngCompression | large | (document) compression level for PNG: small, medium or large |boolean | false | (document) 'false' generates renditions that are the actual size of the layer (as seen by View > Show > Layer Edges within the Photoshop desktop app) but will remove any extra transparent pixel padding. 'true' generates renditions that are the size of the canvas, either trimming the layer to the visible portion of the canvas or padding extra space. If the requested file format supports transparency than transparent pixels will be used for padding, otherwise white pixels will be used. |Array.<LayerReference> | | (document) An array of layer objects. By including this array you are signaling that you'd like a rendition created from these layer id's or layer names. Excluding it will generate a document-level rendition. |IccProfile | | (document) Describes the ICC profile to convert to |objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| Contrast | number | integer [ -100 .. 100 ] |
| Saturation | number | integer [ -100 .. 100 ] |
| VignetteAmount | number | integer [ -100 .. 100 ] |
| Vibrance | number | integer [ -100 .. 100 ] |
| Highlights | number | integer [ -100 .. 100 ] |
| Shadows | number | integer [ -100 .. 100 ] |
| Whites | number | integer [ -100 .. 100 ] |
| Blacks | number | integer [ -100 .. 100 ] |
| Clarity | number | integer [ -100 .. 100 ] |
| Dehaze | number | integer [ -100 .. 100 ] |
| Texture | number | integer [ -100 .. 100 ] |
| Sharpness | number | integer [ 0 .. 150 ] |
| ColorNoiseReduction | number | integer [ 0 .. 100 ] |
| NoiseReduction | number | integer [ 0 .. 100 ] |
| SharpenDetail | number | integer [ 0 .. 100 ] |
| SharpenEdgeMasking | number | integer [ 0 .. 10 ] |
| Exposure | number | float [ -5 .. 5 ] |
| SharpenRadius | number | float [ 0.5 .. 3 ] |
| WhiteBalance | WhiteBalance | white balance |
objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| top | number | Top position of the layer |
| left | number | Left position of the layer |
| width | number | Layer width |
| height | number | Layer height |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [clip] | boolean | | Indicates if this is a clipped layer |
| [enabled] | boolean | true | Indicates a mask is enabled on that layer or not. |
| [linked] | boolean | true | Indicates a mask is linked to the layer or not. |
| [offset] | object | | An object to specify mask offset on the layer. |
| [offset.x] | number | 0 | Offset to indicate horizontal move of the mask |
| [offset.y] | number | 0 | Offset to indicate vertical move of the mask |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [opacity] | number | 100 | Opacity value of the layer |
| [blendMode] | BlendMode | "normal" | Blend mode of the layer |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [brightness] | number | 0 | Adjustment layer brightness (-150...150) |
| [contrast] | number | 0 | Adjustment layer contrast (-150...150) |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [exposure] | number | 0 | Adjustment layer exposure (-20...20) |
| [offset] | number | 0 | Adjustment layer exposure offset (-0.5...0.5) |
| [gammaCorrection] | number | 1 | Adjustment layer gamma correction (0.01...9.99) |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [channel] | string | "\"master\"" | Allowed values: "master" |
| [hue] | number | 0 | Hue adjustment (-180...180) |
| [saturation] | number | 0 | Saturation adjustment (-100...100) |
| [lightness] | number | 0 | Lightness adjustment (-100...100) |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [colorize] | boolean | false | Colorize |
| [channels] | Array.<HueSaturationChannel> | [] | An array of hashes representing the 'master' channel (the remaining five channels of 'magentas', 'yellows', 'greens', etc are not yet supported) |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [preserveLuminosity] | boolean | true | Preserve luminosity |
| [shadowLevels] | Array.<number> | [0,0,0] | Shadow levels (-100...100) |
| [midtoneLevels] | Array.<number> | [0,0,0] | Midtone levels (-100...100) |
| [highlightLevels] | Array.<number> | [0,0,0] | Highlight levels (-100...100) |
objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| [brightnessContrast] | BrightnessContrast | Brightness and contrast settings |
| [exposure] | Exposure | Exposure settings |
| [hueSaturation] | HueSaturation | Hue and saturation settings |
| [colorBalance] | ColorBalance | Color balance settings |
objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| red | number | Red color (0...32768) |
| green | number | Green color (0...32768) |
| blue | number | Blue color (0...32768) |
objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| cyan | number | Cyan color (0...32768) |
| magenta | number | Magenta color (0...32768) |
| yellowColor | number | Yellow color (0...32768) |
| black | number | Black color (0...32768) |
objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| gray | number | Gray color (0...32768) |
objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| rgb | FontColorRgb | Font color settings for RGB mode (16-bit) |
| cmyk | FontColorCmyk | Font color settings for CMYK mode (16-bit) |
| gray | FontColorGray | Font color settings for Gray mode (16-bit) |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [from] | number | | The beginning of the range of characters that this characterStyle applies to. Based on initial index of 0. For example a style applied to only the first two characters would be from=0 and to=1 |
| [to] | number | | The ending of the range of characters that this characterStyle applies to. Based on initial index of 0. For example a style applied to only the first two characters would be from=0 and to=1 |
| [fontSize] | number | | Font size (in points) |
| [fontName] | string | | Font postscript name (see https://github.com/AdobeDocs/photoshop-api-docs/blob/master/SupportedFonts.md) |
| [orientation] | TextOrientation | "horizontal" | Text orientation |
| [fontColor] | FontColor | | The font color settings (one of rgb, cmyk, gray, lab) |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [alignment] | ParagraphAlignment | "left" | Paragraph alignment |
| [from] | number | | The beginning of the range of characters that this paragraphStyle applies to. Based on initial index of 0. For example a style applied to only the first two characters would be from=0 and to=1 |
| [to] | number | | The ending of the range of characters that this characterStyle applies to. Based on initial index of 0. For example a style applied to only the first two characters would be from=0 and to=1 |
objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| content | string | The text string |
| [characterStyles] | Array.<CharacterStyle> | If the same supported attributes apply to all characters in the layer than this will be an array of one item, otherwise each characterStyle object will have a 'from' and 'to' value indicating the range of characters that the style applies to. |
| [paragraphStyles] | Array.<ParagraphStyle> | If the same supported attributes apply to all characters in the layer than this will be an array of one item, otherwise each paragraphStyle object will have a 'from' and 'to' value indicating the range of characters that the style applies to. |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| type | string | | Desired image format for the smart object |
| [linked] | boolean | false | Indicates if this smart object is linked. |
| [path] | string | | Relative path for the linked smart object |
objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| solidColor | object | An object describing the solid color type for this fill layer. Currently supported mode is RGB only. |
| solidColor.red | number | Red color (0...255) |
| solidColor.green | number | Green color (0...255) |
| solidColor.blue | number | Blue color (0...255) |
objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| [id] | number | The id of the layer you want to move above. Use either id OR name. |
| [name] | string | The name of the layer you want to move above. Use either id OR name. |
objectKind: global typedef
Properties
| Name | Type | Description |
| --- | --- | --- |
| [insertAbove] | LayerReference | Used to add the layer above another. If the layer ID indicated is a group layer than the layer will be inserted above the group layer. |
| [insertBelow] | LayerReference | Used to add the layer below another. If the layer ID indicated is a group layer than the layer will be inserted below (and outside of) the group layer |
| [insertInto] | LayerReference | Used to add the layer inside of a group. Useful when you need to move a layer to an empty group. |
| [insertTop] | boolean | Indicates the layer should be added at the top of the layer stack. |
| [insertBottom] | boolean | Indicates the layer should be added at the bottom of the layer stack. If the image has a background image than the new layer will be inserted above it instead. |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [moveChildren] | boolean | true | If layer is a group layer than true = move the set as a unit. Otherwise an empty group is moved and any children are left where they were, un-grouped. |
| [insertAbove] | LayerReference | | Used to move the layer above another. If the layer ID indicated is a group layer than the layer will be inserted above the group layer. |
| [insertBelow] | LayerReference | | Used to move the layer below another. If the layer ID indicated is a group layer than the layer will be inserted below (and outside of) the group layer |
| [insertInto] | LayerReference | | Used to move the layer inside of a group. Useful when you need to move a layer to an empty group. |
| [insertTop] | boolean | | Indicates the layer should be moved at the top of the layer stack. |
| [insertBottom] | boolean | | Indicates the layer should be moved at the bottom of the layer stack. If the image has a background image than the new layer will be inserted above it instead. |
objectKind: global typedef
Properties
| Name | Type | Default | Description |
| --- | --- | --- | --- |
| type | LayerType | | The layer type |
| [id] | number | | (modify, manifest) The layer id |
| [index] | number | | (modify, manifest) The layer index. Required when deleting a layer, otherwise not used |
| [children] | Array.<Layer> | | (manifest) An array of nested layer objects. Only layerSections (group layers) can include children |
| [thumbnail] | string | | (manifest) If thumbnails were requested, a presigned GET URL to the thumbnail |
| [name] | string | | Layer name |
| [locked] | boolean | false | Is the layer locked |
| [visible] | boolean | true | Is the layer visible |
| input | Input | | (create, modify) An object describing the input file to add or replace for a Pixel or Embedded Smart object layer. Supported image types are PNG or JPEG. Images support bounds. If the bounds do not reflect the width and height of the image the image will be resized to fit the bounds. Smart object replacement supports PNG, JPEG, PSD, SVG, AI, PDF. Added images are always placed at (top,left = 0,0) and bounds are ignored. Edited images are replaced for exact pixel size |
| [adjustments] | AdjustmentLayer | | Adjustment layer attributes |
| [bounds] | Bounds | | The bounds of the layer, applicable to: LAYER, TEXT_LAYER, ADJUSTMENT_LAYER, LAYER_SECTION, SMART_OBJECT, FILL_LAYER |
| [mask] | LayerMask | | An object describing the input mask to be added or replaced to the layer. Supported mask type is Layer Mask. The input file must be a greyscale image. Supported file types are jpeg, png and psd. |
| [smartObject] | SmartObject | | An object describing the attributes specific to creating or editing a smartObject. SmartObject properties need the input smart object file to operate on, which can be obtained from Input block. Currently we support Embedded Smart Object only. So this block is optional. If you are creating a Linked Smart Object, this is a required block. |
| [fill] | FillLayer | | Fill layer attributes |
| [text] | TextLayer | | Text layer attributes |
| [blendOptions] | BlendOptions | | Blend options of a layer, including opacity and blend mode |
| [fillToCanvas] | boolean | false | Indicates if this layer needs to be proportionally filled in to the entire canvas of the document. Applicable only to layer type="smartObject" or layer type="layer". |
| [horizontalAlign] | HorizontalAlignment | | Indicates the horizontal position where this layer needs to be placed at. Applicable only to layer type="smartObject" or layer type="layer". |
| [verticalAlign] | VerticalAlignment | | Indicates the vertical position where this layer needs