Edit in GitHubLog an issue

Supported Features

This is a list of currently supported features in the Adobe Photoshop API, which is now available through Adobe Firefly Services.

Photoshop Actions

An action is a series of tasks that you play back on a single file or a batch of files—menu commands, panel options, tool actions, and more. For example, you can create an action that changes the size of an image, applies an effect to the image, and then saves the file in the desired format. All of these taks could be executed in one API call.

Actions created in Photoshop produce an ATN file which can then be used to edit images programmtically using our API.

For more information on how to create Photoshop Actions, see the Adobe Help Center.

Supported Input and Output formats

  • PSD
  • JPEG
  • PNG
  • TIFF

Usage Recommendations

  • We currently do not support operating system dialogs but all other Photoshop dialogs are supported.
  • We recommended creating Actions that do not require user interactions.
  • Make sure to test your actions on Photoshop, with several different input/images. If it has any errors in Photoshop, it won't run successfully on our servers either.

Known Limitations

The following are known limitations:

  • 3D and Video features are not supported.
  • Custom presets (for example color swatches and brushes).
  • This endpoint does not currently support multiple file inputs.

You can choose to playback all of the tasks recorded in an Action or you can selectively choose a particular task within and exclude the rest.

Here are some examples of submitting and executing Photoshop Actions:

In this example we applied a custom Action called "Graphic Design." This ATN file had over 75 recorded Photoshop tasks including Select Subject, Camera Raw Filer adjustments, Content-Aware Fill, Transform, Fill Layer, and more. alt image

ActionJson

Similar to the Photoshop Actions endpoint, this endpoint also allows you to apply the contents of ATN file to an image programmatically. However, there are a few key differences which give you added flexibility.

  • Ability to modify the payload.
  • You don’t need to upload and store your ATN file as you do with the Photoshop Actions endpoint.

In the example below we took the same input image and ATN file from the previous example and dynamically modified the Action to execute all of the same tasks with an adiitional step of adding a black and white filter.

alt image You can find a code sample here

The actionJSON endpoint has the capability of supporting multiple inputs. If you would like to learn more about using multiple inputs with actionJSON, you can find an example here.

Take a look at this aweosme demo of the actionJson endpoint to learn more.

Create new actionJSON using developer mode.

If you have “developer mode” enabled in Photoshop follow the instructions below. If you don't have "developer mode" enabled below please see the section below labeled "How to enable developer mode."

  • Open Photoshop desktop application
  • Click on "Plugins” from the top menu
  • Select “Development”
  • And then choose “Record Action Commands..."
  • Name your file and click on “Save”
  • You can now make edits to your document and all of your edits will be saved

Once you are done recording your action:

  • Click on "Plugins” from the top menu
  • Select “Development”
  • Choose “Stop Action Recording"

The file will be saved to the directory you chose when you named your file.

Create new actionJSON using actions panel

  • Open Photoshop
  • Click on "Open action panel”
  • Select “Create new Action”
  • Select your single action from action set
  • Click on copy as Javascript
  • Paste it in any text editor
  • Modify the file to trim out the actions (example is shown below in the code sample)
  • Use the action in your payload

Convert an existing Action (.atn) file into actionJSON

  • This endpoint will allow to convert an .atn file to actionJSON format. This is the simplest and easiest way to create an actionJSON file.

Convert an existing Action (.atn) file into actionJSON using Photoshop

  • Open Photoshop
  • Click on "Open action panel”
  • Select “Load action”
  • Choose the action you would like to convert to actionJSON
  • Click on copy as Javascript
  • Paste it in any text editor
  • Modify the file to trim out the actions obj blocks (example is shown below in the code sample)
  • Use the action in your payload

A code sample of Action JSON when you copy as Javascript

Copied to your clipboard
async function vignetteSelection() {
let result;
let psAction = require("photoshop").action;
let command = [
// Make snapshot
{"_obj":"make","_target":[{"_ref":"snapshotClass"}],"from":{"_property":"currentHistoryState","_ref":"historyState"},"using":{"_enum":"historyState","_value":"fullDocument"}},
// Feather
{"descriptor": {"_obj":"feather","radius":{"_unit":"pixelsUnit","_value":5.0}}, "options": {"dialogOptions": "display"}},
// Layer Via Copy
{"_obj":"copyToLayer"},
// Show current layer
{"_obj":"show","null":[{"_enum":"ordinal","_ref":"layer","_value":"targetEnum"}],"toggleOptionsPalette":true},
// Make layer
{"_obj":"make","_target":[{"_ref":"layer"}]},
// Fill
{"_obj":"fill","mode":{"_enum":"blendMode","_value":"normal"},"opacity":{"_unit":"percentUnit","_value":100.0},"using":{"_enum":"fillContents","_value":"white"}},
// Move current layer
{"_obj":"move","_target":[{"_enum":"ordinal","_ref":"layer","_value":"targetEnum"}],"to":{"_enum":"ordinal","_ref":"layer","_value":"previous"}}
];
result = await psAction.batchPlay(command, {});
}
async function runModalFunction() {
await require("photoshop").core.executeAsModal(vignetteSelection, {"commandName": "Action Commands"});
}
await runModalFunction();

Modify the javascript file to trim out the actions. Remove everything else from the javascript file and copy the array containing _obj from the command variable which will look something like below

Copied to your clipboard
[
{"_obj":"make","_target":[{"_ref":"snapshotClass"}],"from":{"_property":"currentHistoryState","_ref":"historyState"},
"using":{"_enum":"historyState","_value":"fullDocument"}},
{"_obj":"feather","radius":{"_unit":"pixelsUnit","_value":5.0}},
{"_obj":"copyToLayer"},
{"_obj":"show","null":[{"_enum":"ordinal","_ref":"layer","_value":"targetEnum"}],"toggleOptionsPalette":true},
{"_obj":"make","_target":[{"_ref":"layer"}]},
{"_obj":"fill","mode":{"_enum":"blendMode","_value":"normal"},"opacity":{"_unit":"percentUnit","_value":100.0},"using":{"_enum":"fillContents","_value":"white"},
{"_obj":"move","_target":[{"_enum":"ordinal","_ref":"layer","_value":"targetEnum"}],"to":{"_enum":"ordinal","_ref":"layer","_value":"previous"}}
]

More details about actionJSON can be found here

How to enable developer mode

  • Open Photoshop

  • On the menu bar, select Photoshop → Preferences → Plugins... (For Mac) Or Edit → Preferences → Plugins...(For Windows)

  • Enable Developer Mode alt image

  • Completely Exit Photoshop

  • Enable Hidden Feature if you are using Photoshop 23.4 (July 2022) or earlier. Execute the command below.

    For Mac

    Copied to your clipboard
    echo "UXPEnableScriptingUtilities 1" >> "/Users/$USER/Library/Preferences/Adobe Photoshop 2021 Settings/PSUserConfig.txt"

    For Windows Powershell

    Copied to your clipboard
    echo "UXPEnableScriptingUtilities 1" >> "C:\Users\$env:USERNAME\AppData\Roaming\Adobe\Adobe Photoshop 2021\Adobe Photoshop 2021 Settings\PSUserConfig.txt"
  • Open Photoshop

Smart Object

The Smart Object endpoint allows you to create and edit an embedded Smart Objects within a PSD. The Smart Object that's replaced will be positioned within the bounding box of the original image. Whether the new image is larger or smaller than the original, it will adjust to fit within the original bounding box while preserving its aspect ratio. To alter the bounds of the replaced image, you can specify bounds parameters in the API call.

Known Limitations

  • If your document contains transparent pixels, (e.g some .png), you may not get consistent bounds.
  • We currently do not support Linked Smart Objects.
  • In order to update an embedded Smart Object that is referenced by multiple layers you need to update each of those layers in order for the Smart Object to be replaced in those layers.

Here is an example of replacing a Smart Object within a layer. For better performance, we rasterize our smart objects that are bigger than 2000 pixels * 2000 pixels. For optimal processing, please make sure the embedded smart object that you want to replace only contains alphanumeric characters in it's name.

In this example, we generated a Smart Object within the "socks" layer and utilized the API to substitute the original image with a new pattern. This process facilitated the creation of two variations of the identical photograph. alt image

Text

The Edit Text endpoint supports editing one or more text layers within a PSD.

It enables users to

  • Format text properties such as antialias, orientation and be able to edit text contents. (Note: Changing only the text properties will not change any character/paragraph styling).
  • Some of the key character properties that can be formatted include (but not limited to):
    • Text treatments such as strikethrough, underline, fontCaps.
    • Character size and color.
    • Line and character spacing through leading, tracking, autoKern settings.
  • All the paragraph properties are supported.
  • Use custom fonts when specified through the options.fonts section in the API request body.

Usage Recommendations

  • Ensure that the input file is a PSD and that it contains one or more text layers.
  • Please refer to Font Handling and Handle Missing Fonts for a better understanding.
  • You can find a code sample here.

Known Limitations

  • The API cannot automatically detect missing fonts in the layers. To prevent potential missing fonts from being replaced, please provide a href to the font(s) in the options.fonts section of the API. For more details on specifying custom fonts, please refer to the example section below.

In this example, the font on the original image was altered using the Text API, as depicted in the image on the left. alt image

Product Crop

The Product Crop endpoint facilitates smart cropping for images, automatically detecting the subject and ensuring it remains the focal point of the cropped image. You can identify the product and specify the desired padding for their cropped image. You can see some sample code here.

Known Limitations

  • The current model is trained to return a crop that respects the salient object within an image. There is a current known issue that when a person or portrait is contained within a salient object, the model will crop with the person as the focal area rather than the salient object that contains it. This is problematic in the case of an item where an image of a person is contained within a design (i.e. a t-shirt, collectible or art). Rather than crop to the intended item, the service will crop to the person within the item. We intend to correct this issue in future releases.

DepthBlur

The DepthBlur API supports applying depth blur to your image. Depth Blur is part of the Neural Filters gallery in Photoshop. It allows you to target the area and range of blur in photos, creating wide-aperture depth of field blur effects. You may choose different focal points or remove the focal point and control the depth blur through manipulating the focal range slider. Setting focusSubject to true will select the most prominent subject in the image and apply depth blur around that subject.

You can find a code sample here.

Rendering / Conversions

This endpoint allows you to create a new PSD document and various renditions of different sizes. You can also convert any supported input file format to PSD, JPEG, TIFF, or PNG

  • Create a new PSD document.
  • Create a JPEG, TIFF or PNG rendition of various sizes.
  • Request thumbnail previews of all renderable layers.
  • Convert between any of the supported filetypes (PSD, JPEG, TIFF, PNG).

Here is an example of creating JPEG and PNG rendtions of a PSD document: Render PSD document

Layer level edits

  • General layer edits
    • Edit the layer name.
    • Toggle the layer locked state.
    • Toggle layer visibility.
    • Move or resize the layer via it's bounds.
    • Delete layers.
  • Adjustment layers
    • Add or edit an adjustment layer. The following types of adjustment layers are currently supported:
      • Brightness and Contrast.
      • Exposure.
      • Hue and Saturation.
      • Color Balance.
  • Image/Pixel layers
    • Add a new pixel layer, with optional image.
    • Swap the image in an existing pixel layer.
  • Shape layers
    • Resize a shape layer via it's bounds.

Add, edit and delete layers

The /documentOperations API should primarily be used to make layer and/or document level edits to your PSD and then generate new renditions with the changes. You can pass in a flat array of only the layers that you wish to act upon, in the options.layers argument of the request body. The layer name (or the layer id) will be used by the service to identify the correct layer to operation upon in your PSD.

The add, edit, move and delete blocks indicate the action you would like to be taken on a particular layer object. Any layer block passed into the API that is missing one of these attributes will be ignored. The add and move blocks must also supply one of the attributes insertAbove, insertBelow, insertInto, insertTop or insertBottom to indicate where you want to move the layer to. More details on this can be found in the API reference.

Note: Adding a new layer does not require the ID to be included, the service will generate a new layer id for you.

Here are some examples of making various layer level edits.

Text layers Edits

The Photoshop API currently supports creating and editing of Text Layer with different fonts, character styles and paragraph styles. The set of text attributes that can be edited is listed below:

  • Edit the text contents
  • Change the font (See the Fonts section for more info)
  • Edit the font size
  • Change the font color in the following formats: rgb, cmyk, gray, lab
  • Edit the text orientation (horizontal/vertical)
  • Edit the paragraph alignment (left, center, right, justify, justifyLeft, justifyCenter, justifyRight)

We also have an example of making a simple text layer edit.

Text layer Example Code

Font handling

In order to be able to correctly operate on text layers in the PSD, the corresponding fonts needed for these layers will need to be available when the server is processing the PSD. These include fonts from the following cases:

  1. The font that is in the text layer being edited, but the font itself is not being changed
  2. If the font in a text layer is being changed to a new font

While referencing fonts in the API request, please ensure that the correct Postscript name for that font is used. Referencing to that font with any other name will result in the API treating this as a missing font.

The Photoshop APIs supports using the following category of fonts:

  • You can find a list of currently supported fonts here
  • Custom/Other Fonts: These are the fonts that are either owned by you or the ones that only you are authorized to use. To use a custom font you must include an href to the font in your request. Look at the options.fonts section of the API docs for more information. For including an href to the font in your request, please ensure the font file name to be in this format: <font_postscript_name>.<ext>, when it is being uploaded in your choice of storage. A sample options.fonts section will look like so:
    Copied to your clipboard
    {
    "storage": "external",
    "href": "<Storage URL to OpenSansCondensed-Light.ttf>"
    }
    Note: This also applies to any other font present in the document which is not to be found in the first 2 categories above.

Here is an example usage of a custom font

Handle missing fonts in the document.

The API provides two options to control the behavior when there are missing fonts, as the request is being processed:

  • Specify a global font which would act as a default font for the current request: The globalFont field in the options section of the request can be used to specify the full postscript name of this font. For any textLayer edit/add operation, if the font used specifically for that layer is missing, this font will be used as the default. If the global font itself is missing, then the action to be taken will be dictated by the manageMissingFonts options as explained here in the next bullet point.

Note: If using an OAuth integration, Adobe Fonts can be used as a global font as well. If the global font is a custom font, please upload the font to one of the cloud storage types that is supported and specify the href and storage type in the options.fonts section of the request.

  • Specify the action to be taken if one or more fonts required for the add/edit operation(s) are missing: The manageMissingFonts field in the options section of the request can be used to specify this action. It can accept one of the following 2 values:
    • fail to force the request/job to fail
    • useDefault to use our system designated default font, which is: ArialMT

In this example we show you how to andle missing fonts using the manageMissingFonts and globalFont options.

Limitations

  • Most of the text attributes retain their respective original values. There are some attributes however that do not retain their original values. For example (and not limited to): tracking, leading, kerning.

Supported Fonts

This is a list of all of the supported Postscript fonts for Photoshop API.

Photoshop CC

AcuminVariableConcept
AdobeArabic-Bold
AdobeArabic-BoldItalic
AdobeArabic-Italic
AdobeArabic-Regular
AdobeDevanagari-Bold
AdobeDevanagari-BoldItalic
AdobeDevanagari-Italic
AdobeDevanagari-Regular
AdobeFanHeitiStd-Bold
AdobeGothicStd-Bold
AdobeGurmukhi-Bold
AdobeGurmukhi-Regular
AdobeHebrew-Bold
AdobeHebrew-BoldItalic
AdobeHebrew-Italic
AdobeHebrew-Regular
AdobeHeitiStd-Regular
AdobeMingStd-Light
AdobeMyungjoStd-Medium
AdobePiStd
AdobeSongStd-Light
AdobeThai-Bold
AdobeThai-BoldItalic
AdobeThai-Italic
AdobeThai-Regular
CourierStd
CourierStd-Bold
CourierStd-BoldOblique
CourierStd-Oblique
EmojiOneColor
KozGoPr6N-Bold
KozGoPr6N-Medium
KozGoPr6N-Regular
KozMinPr6N-Regular
MinionPro-Regular
MinionVariableConcept-Italic
MinionVariableConcept-Roman
MyriadArabic-Bold
MyriadArabic-BoldIt
MyriadArabic-It
MyriadArabic-Regular
MyriadHebrew-Bold
MyriadHebrew-BoldIt
MyriadHebrew-It
MyriadHebrew-Regular
MyriadPro-Bold
MyriadPro-BoldIt
MyriadPro-It
MyriadPro-Regular
MyriadVariableConcept-Italic
MyriadVariableConcept-Roman
NotoSansKhmer-Regular
NotoSansLao-Regular
NotoSansMyanmar-Regular
NotoSansSinhala-Regular
SourceCodeVariable-Italic
SourceCodeVariable-Roman
SourceSansVariable-Italic
SourceSansVariable-Roman
SourceSerifVariable-Roman
TrajanColor-Concept

Document level edits

  • Crop a PSD
  • Resize a PSD

Artboards

  • Show artboard information in the JSON Manifest
  • Create a new artboard from multiple input psd's

Remove Background

The Remove Background endpoint can recognize the primary subject within an image and eliminate the background, providing the subject as the output. You can see a code sample here..

Example of Remove Background with a sample image. alt image

Create Mask

This endpoint allows you create a greyscale mask png file that you can composite onto the original image (or any other). You can find a code sample here..

Note: If using this output for an input file in the Adobe Firefly API you must invert the mask which can be done using the Action JSON endpoint.

Example of Image mask with a sample image. alt image

Customized Workflow

You can make a customized workflow by chaining different endpoints together. Here is an example using the Remove Background endpoint.

Webhooks through Adobe I/O Events

Adobe I/O Events offers the possibility to build an event-driven application, based on events originating from Photoshop. To start listening for events, your application needs to register a webhook URL, specifying the Event Types to receive. Whenever a matching event gets triggered, your application is notified through an HTTP POST request to the webhook URL. The Event Provider for Photoshop APIs is Imaging API Events. This event provider has two event types:

  1. Photoshop API events

As the names indicate, these event types represent events triggered by the individual APIs.

Registering your application to our Event Provider

Prerequisites needed to use the Event Provider

  1. In order to use the Adobe I/O Events you will need to create a project on Adobe I/O Console.
  2. You can follow the steps listed in Getting Started page if you haven't created one yet.
  3. Create a Webhook application
  • You can find a sample NodeJS application here.

Registering the Webhook

Once the above prerequisites are met, you can now proceed to register the webhook to the service integration. The steps to do that can be found here. After the webhook has been successfully registered, you will start to receive the events for any submitted job that either succeeded or failed, from the Event Types selected. This eliminates the need for your application to poll for the status of the job using the jobID. Examples can be found here

  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.