1.1.0 • Published 11 months ago

@adobe/aio-lib-photoshop-api v1.1.0

Weekly downloads
326
License
Apache-2.0
Repository
github
Last release
11 months ago

Version Downloads/week Build Status License Codecov Coverage

Adobe Photoshop API Library

Rest API

The Rest API is documented at:

Installing

$ npm install @adobe/aio-lib-photoshop-api

Usage

1) Initialize the SDK

const sdk = require('@adobe/aio-lib-photoshop-api')

async function sdkTest() {
  try {
    //initialize sdk
    const client = await sdk.init('<ims org id>', '<api key>', '<valid auth token>')
  } 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.

const sdk = require('@adobe/aio-lib-photoshop-api')

async function sdkTest() {
  try {
    // initialize sdk
    const client = await sdk.init('<ims org id>', '<api key>', '<valid auth token>')

    // 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)
  }
}

Usage with Adobe I/O Files access

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.

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('<ims org id>', '<api key>', '<valid auth token>', files)
  } 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.

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('<ims org id>', '<api key>', '<valid auth token>', files)

    // 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)
  }
}

Classes

Functions

Typedefs

FileResolver

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:

  • 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

new FileResolver(files, options)

Construct a file resolver

ParamTypeDescription
files*Adobe I/O Files instance
optionsFileResolverOptionsOptions

fileResolver.presignExpiryInSeconds : number

Expiry time of presigned urls in seconds

Kind: instance property of FileResolver

fileResolver.defaultPathStorage : Storage

Plain paths can reference either Adobe Creative Cloud or Adobe I/O Files.

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

fileResolver.resolveInput(input) ⇒ Input

Resolve input file from href to an object with href and storage

Kind: instance method of FileResolver
Returns: Input - resolved input

ParamTypeDescription
inputstring | InputInput or href to resolve

fileResolver.resolveInputs(inputs) ⇒ Array.<Input>

Resolve input files from hrefs to an array of objects with href and storage

Kind: instance method of FileResolver
Returns: Array.<Input> - resolved files

ParamTypeDescription
inputsstring | Array.<string> | Input | Array.<Input>One or more files

fileResolver.resolveInputsDocumentOptions(options) ⇒ CreateDocumentOptions | ModifyDocumentOptions | ReplaceSmartObjectOptions

Resolve the font and layer inputs in the document options

Kind: instance method of FileResolver
Returns: CreateDocumentOptions | ModifyDocumentOptions | ReplaceSmartObjectOptions - Document options

ParamTypeDescription
optionsCreateDocumentOptions | ModifyDocumentOptions | ReplaceSmartObjectOptionsDocument options

fileResolver.resolveInputsPhotoshopActionsOptions(options) ⇒ ApplyPhotoshopActionsOptions

Resolve the actions, fonts, and custom presets options

Kind: instance method of FileResolver
Returns: ApplyPhotoshopActionsOptions - Photoshop Actions options

ParamTypeDescription
optionsApplyPhotoshopActionsOptionsPhotoshop Actions options

fileResolver.resolveOutput(output) ⇒ Output

Resolve output from href to an object with href, storage, and type

Kind: instance method of FileResolver
Returns: Output - resolved files

ParamTypeDescription
outputstring | File | OutputOne or more output files

fileResolver.resolveOutputs(outputs) ⇒ Array.<Output>

Resolve outputs from href to an object with href, storage, and type

Kind: instance method of FileResolver
Returns: Array.<Output> - resolved files

ParamTypeDescription
outputsstring | Array.<string> | File | Array.<File> | Output | Array.<Output>One or more output files

PhotoshopAPI

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

Kind: global class

photoshopAPI.orgId : string

The IMS organization id

Kind: instance property of PhotoshopAPI

photoshopAPI.apiKey : string

The api key from your integration

Kind: instance property of PhotoshopAPI

photoshopAPI.accessToken : string

The access token from your integration

Kind: instance property of PhotoshopAPI

photoshopAPI.init(orgId, apiKey, accessToken, files, options) ⇒ Promise.<PhotoshopAPI>

Initializes the PhotoshopAPI object and returns it.

Kind: instance method of PhotoshopAPI
Returns: Promise.<PhotoshopAPI> - a PhotoshopAPI object

ParamTypeDescription
orgIdstringthe IMS organization id
apiKeystringthe API key for your integration
accessTokenstringthe access token for your integration
files*Adobe I/O Files instance
optionsPhotoshopAPIOptionsOptions

photoshopAPI.createCutout(input, output) ⇒ Job

Create a cutout mask, and apply it to the input

Kind: instance method of PhotoshopAPI
Returns: Job - Auto cutout job

ParamTypeDescription
inputstring | InputInput file
outputstring | OutputOutput file

photoshopAPI.createMask(input, output) ⇒ Job

Create a cutout mask

Kind: instance method of PhotoshopAPI
Returns: Job - Auto masking job

ParamTypeDescription
inputstring | InputInput file
outputstring | OutputOutput file

photoshopAPI.straighten(input, outputs) ⇒ Job

Straighten photo

Kind: instance method of PhotoshopAPI
Returns: Job - Auto straighten job

ParamTypeDescription
inputstring | InputInput file
outputsstring | Output | Array.<Output>Output file

photoshopAPI.autoTone(input, output) ⇒ Job

Automatically tone photo

Kind: instance method of PhotoshopAPI
Returns: Job - Auto tone job

ParamTypeDescription
inputstring | InputInput file
outputstring | OutputOutput file

photoshopAPI.editPhoto(input, output, options) ⇒ Job

Apply a set of edit parameters on an image

Kind: instance method of PhotoshopAPI
Returns: Job - Edit photo job

ParamTypeDescription
inputstring | InputInput file
outputstring | OutputOutput file
optionsEditPhotoOptionsEdit options

photoshopAPI.applyPreset(input, preset, output) ⇒ Job

Apply a preset on an image

Kind: instance method of PhotoshopAPI
Returns: Job - Apply preset job

ParamTypeDescription
inputstring | InputInput file
presetstring | InputLightroom preset XMP file
outputstring | OutputOutput file

photoshopAPI.applyPresetXmp(input, output, xmp) ⇒ Job

Apply a preset on an image

Kind: instance method of PhotoshopAPI
Returns: Job - Apply preset job

ParamTypeDescription
inputstring | InputInput file
outputstring | OutputOutput file
xmpstringLightroom preset XMP file contents

photoshopAPI.createDocument(outputs, options) ⇒ Job

Create a new psd, optionally with layers, and then generate renditions and/or save as a psd

Kind: instance method of PhotoshopAPI
Returns: Job - Create document job

ParamTypeDescription
outputsstring | Array.<string> | Output | Array.<Output>Desired output
optionsCreateDocumentOptionsDocument create options

photoshopAPI.getDocumentManifest(input, options) ⇒ Job

Extract and return a psd file's layer information

Kind: instance method of PhotoshopAPI
Returns: Job - Get document manifest job

ParamTypeDescription
inputstring | InputAn object describing an input PSD file.Current support is for files less than 1000MB.
optionsobjectavailable options to apply to all input files
options.thumbnailsobjectInclude presigned GET URLs to small preview thumbnails for any renderable layer.
options.thumbnails.typeMimeTypedesired image format. Allowed values: "image/jpeg", "image/png", "image/tiff"

photoshopAPI.modifyDocument(input, outputs, options) ⇒ Job

Apply (optional) psd edits and then generate renditions and/or save a new psd

Kind: instance method of PhotoshopAPI
Returns: Job - Modify document job

ParamTypeDescription
inputstring | InputAn object describing an input PSD file. Current support is for files less than 1000MB.
outputsstring | Array.<string> | Output | Array.<Output>Desired output
optionsModifyDocumentOptionsModify document options

photoshopAPI.createRendition(input, outputs) ⇒ Job

Create renditions

Kind: instance method of PhotoshopAPI
Returns: Job - Create rendition job

ParamTypeDescription
inputstring | InputAn object describing an input file. Currently supported filetypes include: jpeg, png, psd, tiff. Current support is for files less than 1000MB.
outputsstring | Array.<string> | Output | Array.<Output>Desired output

photoshopAPI.replaceSmartObject(input, outputs, options) ⇒ Job

Apply psd edits for replacing embedded smart object and then generate renditions and/or save a new psd

Kind: instance method of PhotoshopAPI
Returns: Job - Replace smart object job

ParamTypeDescription
inputInputAn object describing an input PSD file. Current support is for files less than 1000MB.
outputsstring | Output | Array.<Output>Desired output
optionsReplaceSmartObjectOptionsReplace smart object options

photoshopAPI.applyPhotoshopActions(input, outputs, options) ⇒ Job

Apply Photoshop Actions and then generate renditions and/or save a new image

Kind: instance method of PhotoshopAPI
Returns: Job - Photoshop Actions job

ParamTypeDescription
inputInputAn object describing an input image file. Current support is for files less than 1000MB.
outputsstring | Output | Array.<Output>Desired output
optionsApplyPhotoshopActionsOptionsApply Photoshop Actions options

photoshopAPI.applyPhotoshopActionsJson(input, outputs, options) ⇒ Job

Apply JSON-formatted Photoshop Actions and then generate renditions and/or save a new image

Kind: instance method of PhotoshopAPI
Returns: Job - Photoshop Actions job

ParamTypeDescription
inputInputAn object describing an input image file. Current support is for files less than 1000MB.
outputsstring | Output | Array.<Output>Desired output
optionsApplyPhotoshopActionsJsonOptionsApply Photoshop Actions JSON options

Job

Abstraction around the Photoshop Services Jobs

Kind: global class

new Job(response, getJobStatus)

Construct a job with the ability to acquire status updates

ParamTypeDescription
response*Service response
getJobStatusfunctionAsync function to get job status

job.url : string

URL to request a status update of the job

Kind: instance property of Job

job.jobId : string

Job identifier

Kind: instance property of Job

job.outputs : Array.<JobOutput>

Status of each output sub job

Kind: instance property of Job

job.isDone() ⇒ boolean

Check if the job is done

A 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

job.poll() ⇒ Job

Poll for job status

Kind: instance method of Job
Returns: Job - Job instance

job.pollUntilDone(pollTimeMs) ⇒ Job

Poll job until done

Kind: instance method of Job
Returns: Job - Job instance

ParamTypeDefaultDescription
pollTimeMsnumber2000Polling time

Storage

Storage types

Kind: global enum
Read only: true
Properties

NameDefaultDescription
AIOaiohref is a path in Adobe I/O Files: https://github.com/adobe/aio-lib-files
ADOBEadobehref is a path in Creative Cloud
EXTERNALexternalhref is a presigned get/put url, e.g. AWS S3
AZUREazurehref is an Azure SAS (Shared Access Signature) URL for upload/download
DROPBOXdropboxhref is a temporary upload/download Dropbox link: https://dropbox.github.io/dropbox-api-v2-explorer/

MimeType

Mime types

Kind: global enum
Read only: true
Properties

NameDefaultDescription
DNGimage/x-adobe-dngDigital Negative, available from autoTone, straighten, applyPreset
JPEGimage/jpegJPEG, available from all operations
PNGimage/pngPNG, available from all operations
PSDimage/vnd.adobe.photoshopPhotoshop Document, available from createDocument, modifyDocument, createRendition, replaceSmartObject
TIFFimage/tiffTIFF format, available from createDocument, modifyDocument, createRendition, replaceSmartObject

PngCompression

Compression level for PNG: small, medium or large.

Kind: global enum
Read only: true
Properties

NameDefault
SMALLsmall
MEDIUMmedium
LARGElarge

Colorspace

Color space

Kind: global enum
Read only: true
Properties

NameDefault
BITMAPbitmap
GREYSCALEgreyscale
INDEXEDindexed
RGBrgb
CMYKcmyk
MULTICHANNELmultichannel
DUOTONEduotone
LABlab

StandardIccProfileNames

Standard ICC profile names

Kind: global enum
Read only: true
Properties

NameDefault
ADOBE_RGB_1998Adobe RGB (1998)
APPLE_RGBApple RGB
COLORMATCH_RGBColorMatch RGB
SRGBsRGB IEC61966-2.1
DOTGAIN_10Dot Gain 10%
DOTGAIN_15Dot Gain 15%
DOTGAIN_20Dot Gain 20%
DOTGAIN_25Dot Gain 25%
DOTGAIN_30Dot Gain 30%
GRAY_GAMMA_18Gray Gamma 1.8
GRAY_GAMMA_22Gray Gamma 2.2

CreateMaskType

Type of mask to create

Kind: global enum
Read only: true
Properties

NameDefaultDescription
BINARYbinaryBinary mask
SOFTsoftSoft mask

WhiteBalance

White balance enum

Kind: global enum
Read only: true
Properties

NameDefault
AS_SHOTAs Shot
AUTOAuto
CLOUDYCloudy
CUSTOMCustom
DAYLIGHTDaylight
FLASHFlash
FLUORESCENTFluorescent
SHADEShade
TUNGSTENTungsten

ManageMissingFonts

Action to take if there are one or more missing fonts in the document

Kind: global enum
Read only: true
Properties

NameDefaultDescription
USE_DEFAULTuseDefaultThe job will succeed, however, by default all the missing fonts will be replaced with this font: ArialMT
FAILfailThe 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 fill

Kind: global enum
Read only: true
Properties

NameDefault
WHITEwhite
BACKGROUND_COLORbackgroundColor
TRANSPARENTtransparent

LayerType

Layer type

Kind: global enum
Read only: true
Properties

NameDefaultDescription
LAYERlayerA pixel layer
TEXT_LAYERtextLayerA text layer
ADJUSTMENT_LAYERadjustmentLayerAn adjustment layer
LAYER_SECTIONlayerSectionGroup of layers
SMART_OBJECTsmartObjectA smart object
BACKGROUND_LAYERbackgroundLayerThe background layer
FILL_LAYERfillLayerA fill layer

BlendMode

Blend modes

Kind: global enum
Read only: true
Properties

NameDefault
NORMALnormal
DISSOLVEdissolve
DARKENdarken
MULTIPLYmultiply
COLOR_BURNcolorBurn
LINEAR_BURNlinearBurn
DARKER_COLORdarkerColor
LIGHTENlighten
SCREENscreen
COLOR_DODGEcolorDodge
LINEAR_DODGElinearDodge
LIGHTER_COLORlighterColor
OVERLAYoverlay
SOFT_LIGHTsoftLight
HARD_LIGHThardLight
VIVID_LIGHTvividLight
LINEAR_LIGHTlinearLight
PIN_LIGHTpinLight
HARD_MIXhardMix
DIFFERENCEdifference
EXCLUSIONexclusion
SUBTRACTsubtract
DIVIDEdivide
HUEhue
SATURATIONsaturation
COLORcolor
LUMINOSITYluminosity

TextOrientation

Text orientation

Kind: global enum
Read only: true
Properties

NameDefault
HORIZONTALhorizontal
VERTICALvertical

ParagraphAlignment

Paragraph alignment

Kind: global enum
Read only: true
Properties

NameDefault
LEFTleft
CENTERcenter
RIGHTright
JUSTIFYjustify
JUSTIFY_LEFTjustifyLeft
JUSTIFY_CENTERjustifyCenter
JUSTIFY_RIGHTjustifyRight

HorizontalAlignment

Horizontal alignment

Kind: global enum
Read only: true
Properties

NameDefault
LEFTleft
CENTERcenter
RIGHTright

VerticalAlignment

Vertical alignment

Kind: global enum
Read only: true
Properties

NameDefault
TOPtop
CENTERcenter
BOTTOMbottom

JobOutputStatus

Output status

Kind: global enum
Read only: true
Properties

NameDefaultDescription
PENDINGpendingrequest has been accepted and is waiting to start
RUNNINGrunningthe child job is running
UPLOADINGuploadingfiles have been generated and are uploading to destination
SUCCEEDEDsucceededthe child job has succeeded
FAILEDfailedthe 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

ParamTypeDescription
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

ParamTypeDescription
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 approach

Kind: global function
Returns: * - Swagger options object with relevant settings for fetch module

ParamTypeDescription
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

ParamTypeDescription
orgIdstringIMS organization id
apiKeystringthe API key for your integration
accessTokenstringthe access token for your integration
files*Adobe I/O Files instance
optionsPhotoshopAPIOptionsOptions

FileResolverOptions : object

File resolver options

Kind: global typedef
Properties

NameTypeDefaultDescription
presignExpiryInSecondsnumber3600Expiry time of any presigned urls, defaults to 1 hour
defaultAdobeCloudPathsbooleanTrue if paths should be considered references to files in Creative Cloud

PhotoshopAPIOptions : object

Photoshop API options

Kind: global typedef
Properties

NameTypeDefaultDescription
presignExpiryInSecondsnumber3600Expiry time of any presigned urls, defaults to 1 hour
defaultAdobeCloudPathsbooleanTrue if paths should be considered references to files in Creative Cloud
useSwaggerFetchbooleanfalseTrue if Swagger's fetch implementation should be used, otherwise will use userFetch if provided or @adobe/node-fetch-retry if nothing else.
userFetchfunctionFetch function to use replacing Swagger's fetch and node-fetch-retry. Useful for mocking, etc

Input : object

A reference to an input file

Kind: global typedef
Properties

NameTypeDescription
hrefstringEither an href to a single Creative Cloud asset for storage='adobe' OR a presigned GET URL for other external services.
storageStorageStorage 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

NameTypeDescription
imageModeColorspaceImage mode
inputInputCustom ICC profile href to a Creative Cloud asset or presigned URL
profileNamestringStandard ICC profile name (e.g. Adobe RGB (1998))

Output : object

A reference to an output file, including output options

Kind: global typedef
Properties

NameTypeDefaultDescription
hrefstring(all) Either an href to a single Creative Cloud asset for storage='adobe' OR a presigned GET URL for other external services.
storageStorage(all) Storage type, by default detected based on href
typeMimeType(all) Desired output image format, by default detected based on href extension
overwritebooleantrue(all) If the file already exists, indicates if the output file should be overwritten. Will eventually support eTags. Only applies to CC Storage
maskobject(createMask, createCutout) Type of mask to create
mask.formatCreateMaskType(createMask, createCutout) Binary or soft mask to create
widthnumber0(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
qualitynumber7(document) quality of the renditions for JPEG. Range from 1 to 7, with 7 as the highest quality.
compressionPngCompressionlarge(document) compression level for PNG: small, medium or large
trimToCanvasbooleanfalse(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.
layersArray.<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.
iccProfileIccProfile(document) Describes the ICC profile to convert to

EditPhotoOptions : object

Set of edit parameters to apply to an image

Kind: global typedef
Properties

NameTypeDescription
Contrastnumberinteger -100 .. 100
Saturationnumberinteger -100 .. 100
VignetteAmountnumberinteger -100 .. 100
Vibrancenumberinteger -100 .. 100
Highlightsnumberinteger -100 .. 100
Shadowsnumberinteger -100 .. 100
Whitesnumberinteger -100 .. 100
Blacksnumberinteger -100 .. 100
Claritynumberinteger -100 .. 100
Dehazenumberinteger -100 .. 100
Texturenumberinteger -100 .. 100
Sharpnessnumberinteger 0 .. 150
ColorNoiseReductionnumberinteger 0 .. 100
NoiseReductionnumberinteger 0 .. 100
SharpenDetailnumberinteger 0 .. 100
SharpenEdgeMaskingnumberinteger 0 .. 10
Exposurenumberfloat -5 .. 5
SharpenRadiusnumberfloat 0.5 .. 3
WhiteBalanceWhiteBalancewhite balance

Bounds : object

Layer bounds (in pixels)

Kind: global typedef
Properties

NameTypeDescription
topnumberTop position of the layer
leftnumberLeft position of the layer
widthnumberLayer width
heightnumberLayer height

LayerMask : object

Mask applied to an layer

Kind: global typedef
Properties

NameTypeDefaultDescription
clipbooleanIndicates if this is a clipped layer
enabledbooleantrueIndicates a mask is enabled on that layer or not.
linkedbooleantrueIndicates a mask is linked to the layer or not.
offsetobjectAn object to specify mask offset on the layer.
offset.xnumber0Offset to indicate horizontal move of the mask
offset.ynumber0Offset to indicate vertical move of the mask

BlendOptions : object

Layer blend options

Kind: global typedef
Properties

NameTypeDefaultDescription
opacitynumber100Opacity value of the layer
blendModeBlendMode"normal"Blend mode of the layer

BrightnessContrast : object

Adjustment layer brightness and contrast settings

Kind: global typedef
Properties

NameTypeDefaultDescription
brightnessnumber0Adjustment layer brightness (-150...150)
contrastnumber0Adjustment layer contrast (-150...150)

Exposure : object

Adjustment layer exposure settings

Kind: global typedef
Properties

NameTypeDefaultDescription
exposurenumber0Adjustment layer exposure (-20...20)
offsetnumber0Adjustment layer exposure offset (-0.5...0.5)
gammaCorrectionnumber1Adjustment layer gamma correction (0.01...9.99)

HueSaturationChannel : object

Master channel hue and saturation settings

Kind: global typedef
Properties

NameTypeDefaultDescription
channelstring"\"master\""Allowed values: "master"
huenumber0Hue adjustment (-180...180)
saturationnumber0Saturation adjustment (-100...100)
lightnessnumber0Lightness adjustment (-100...100)

HueSaturation : object

Adjustment layer hue and saturation settings

Kind: global typedef
Properties

NameTypeDefaultDescription
colorizebooleanfalseColorize
channelsArray.<HueSaturationChannel>[]An array of hashes representing the 'master' channel (the remaining five channels of 'magentas', 'yellows', 'greens', etc are not yet supported)

ColorBalance : object

Adjustment layer color balance settings

Kind: global typedef
Properties

NameTypeDefaultDescription
preserveLuminositybooleantruePreserve luminosity
shadowLevelsArray.<number>0,0,0Shadow levels (-100...100)
midtoneLevelsArray.<number>0,0,0Midtone levels (-100...100)
highlightLevelsArray.<number>0,0,0Highlight levels (-100...100)

AdjustmentLayer : object

Adjustment layer settings

Kind: global typedef
Properties

NameTypeDescription
brightnessContrastBrightnessContrastBrightness and contrast settings
exposureExposureExposure settings
hueSaturationHueSaturationHue and saturation settings
colorBalanceColorBalanceColor balance settings

FontColorRgb : object

Font color settings for RGB mode (16-bit)

Kind: global typedef
Properties

NameTypeDescription
rednumberRed color (0...32768)
greennumberGreen color (0...32768)
bluenumberBlue color (0...32768)

FontColorCmyk : object

Font color settings for CMYK mode (16-bit)

Kind: global typedef
Properties

NameTypeDescription
cyannumberCyan color (0...32768)
magentanumberMagenta color (0...32768)
yellowColornumberYellow color (0...32768)
blacknumberBlack color (0...32768)

FontColorGray : object

Font color settings for Gray mode (16-bit)

Kind: global typedef
Properties

NameTypeDescription
graynumberGray color (0...32768)

FontColor : object

Font color settings

Kind: global typedef
Properties

NameTypeDescription
rgbFontColorRgbFont color settings for RGB mode (16-bit)
cmykFontColorCmykFont color settings for CMYK mode (16-bit)
grayFontColorGrayFont color settings for Gray mode (16-bit)

CharacterStyle : object

Character style settings

Kind: global typedef
Properties

NameTypeDefaultDescription
fromnumberThe 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
tonumberThe 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
fontSizenumberFont size (in points)
fontNamestringFont postscript name (see https://github.com/AdobeDocs/photoshop-api-docs/blob/master/SupportedFonts.md)
orientationTextOrientation"horizontal"Text orientation
fontColorFontColorThe font color settings (one of rgb, cmyk, gray, lab)

ParagraphStyle : object

Paragraph style

Kind: global typedef
Properties

NameTypeDefaultDescription
alignmentParagraphAlignment"left"Paragraph alignment
fromnumberThe 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
tonumberThe 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

TextLayer : object

Text layer settings

Kind: global typedef
Properties

NameTypeDescription
contentstringThe text string
characterStylesArray.<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.
paragraphStylesArray.<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.

SmartObject : object

Smart object settings

Kind: global typedef
Properties

NameTypeDefaultDescription
typestringDesired image format for the smart object
linkedbooleanfalseIndicates if this smart object is linked.
pathstringRelative path for the linked smart object

FillLayer : object

Fill layer settings

Kind: global typedef
Properties

NameTypeDescription
solidColorobjectAn object describing the solid color type for this fill layer. Currently supported mode is RGB only.
solidColor.rednumberRed color (0...255)
solidColor.greennumberGreen color (0...255)
solidColor.bluenumberBlue color (0...255)

LayerReference : object

Layer reference

Kind: global typedef
Properties

NameTypeDescription
idnumberThe id of the layer you want to move above. Use either id OR name.
namestringThe name of the layer you want to move above. Use either id OR name.

AddLayerPosition : object

Position where to add the layer in the layer hierarchy

Kind: global typedef
Properties

NameTypeDescription
insertAboveLayerReferenceUsed 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.
insertBelowLayerReferenceUsed 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
insertIntoLayerReferenceUsed to add the layer inside of a group. Useful when you need to move a layer to an empty group.
insertTopbooleanIndicates the layer should be added at the top of the layer stack.
insertBottombooleanIndicates 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.

MoveLayerPosition : object

Position where to move the layer to in the layer hierarchy

Kind: global typedef
Properties

NameTypeDefaultDescription
moveChildrenbooleantrueIf 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.
insertAboveLayerReferenceUsed 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.
insertBelowLayerReferenceUsed 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
insertIntoLayerReferenceUsed to move the layer inside of a group. Useful when you need to move a layer to an empty group.
insertTopbooleanIndicates the layer should be moved at the top of the layer stack.
insertBottombooleanIndicates 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.

Layer : object

Layer to add, replace, move or delete when manipulating a Photoshop document, or retrieved from the manifest

Kind: global typedef
Properties

NameTypeDefaultDescription
typeLayerTypeThe layer type
idnumber(modify, manifest) The layer id
indexnumber(modify, manifest) The layer index. Required when deleting a layer, otherwise not used
childrenArray.<Layer>(manifest) An array of nested layer objects. Only layerSections (group layers) can include children
thumbnailstring(manifest) If thumbnails were requested, a presigned GET URL to the thumbnail
namestringLayer name
lockedbooleanfalseIs the layer locked
visiblebooleantrueIs the layer visible
inputInput(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
adjustmentsAdjustmentLayerAdjustment layer attributes
boundsBoundsThe bounds of the layer, applicable to: LAYER, TEXT_LAYER, ADJUSTMENT_LAYER, LAYER_SECTION, SMART_OBJECT, FILL_LAYER
maskLayerMaskAn 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.
smartObjectSmartObjectAn 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.
fillFillLayerFill layer attributes
textTextLayerText layer attributes
blendOptionsBlendOptionsBlend options of a layer, including opacity and blend mode
fillToCanvasbooleanfalseIndicates 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".
horizontalAlignHorizontalAlignmentIndicates the horizontal position where this layer needs to be placed at. Applicable only to layer type="smartObject" or layer type="layer".
verticalAlignVerticalAlignmentIndicates the vertical position where this layer needs