Photoshop MCP Server
v0.1.0Drive Adobe Photoshop from any MCP client: layers, selections, adjustments, type and export.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_documents List Documents
List open documents with their size in pixels, resolution, colour mode, bit depth, file and whether they have unsaved changes
get_document_info Get Document Info
Describe the active document: size in pixels, resolution, mode, bit depth, colour profile, layer count, active layer, channels, guides, selection bounds and history
create_document Create Document
Create a document (File > New, Preset Details) with a size in pixels, resolution, colour mode, bit depth, background fill, pixel aspect ratio and optional colour profile, optionally as an artboard document
| Parameter | Type | Description |
|---|---|---|
height * | number | Pixels |
width * | number | Pixels |
artboard | boolean | Create the document with an artboard (the New Document Artboards option). Default false |
bitsPerChannel | integer | Default 8 |
colorProfile | string | Profile name, e.g. "sRGB IEC61966-2.1" |
fill | string | Background contents. Default white |
mode | string | Default rgb |
name | string | Document name |
pixelAspectRatio | number | Pixel width over height for video work, e.g. 0.9 for D1/DV NTSC. Default 1 (square) |
resolution | number | Pixels per inch. Default 72 |
open_document Open Document
Open a file (File > Open, Open As): PSD, PSB, TIFF, JPEG, PNG, GIF, BMP, PDF, EPS, DCS, camera raw and DNG, HEIF, WebP, AVIF, JPEG XL, JPEG 2000, OpenEXR, Radiance, Cineon, DICOM, IFF, PCX, PICT, Pixar, PBM, Scitex CT, Targa, WBMP, Photoshop 2.0, Photoshop Raw, video and audio (as video layers), or a .psdt template (which opens as a new untitled document). openAs reads the file as PDF, EPS, Photoshop Raw or DICOM with that format's options, also when the extension does not match the contents
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Absolute path |
asSmartObject | boolean | Open as a smart object. Default false |
openAs | string | Read the file as this format, with options. pdf: a generic (not Photoshop) PDF page or image, rasterized (Import PDF). eps: rasterize generic EPS. raw: headerless Photoshop Raw data. dicom: medical im… |
options | object | pdf: select (page|image): open a page or an embedded image. Default page; page (integer 1-100000): page (or image) number, from 1; name (text): name of the new document; cropTo (bounding_box|media_box… |
save_document Save Document
Save the active document in place, or at filePath in the format its extension names, with that format's options (File > Save As): PSD, PSB (Large Document Format), TIFF, PNG, JPEG, Photoshop PDF, GIF, Photoshop EPS, DCS 1.0 and 2.0 (.eps with epsType), BMP, Targa (.tga), Pixar (.pxr) or Photoshop Raw (.raw). With asCopy the document keeps referring to its own file
| Parameter | Type | Description |
|---|---|---|
alphaChannels | boolean | PSD, TIFF: keep alpha channels |
asCopy | boolean | Save a copy. Default false |
compression | TIFF: none, lzw (default), zip or jpeg. PNG: 0-9 (default 6) | |
embedColorProfile | boolean | Embed the colour profile (PSD, TIFF, JPEG, PDF, EPS, DCS). Default true |
epsType | string | .eps files: Photoshop EPS (default), Photoshop DCS 1.0 or DCS 2.0 (CMYK documents; DCS 2.0 keeps spot channels) |
filePath | string | Absolute path ending in .psd, .psb, .tif, .tiff, .png, .jpg, .jpeg, .pdf, .gif, .eps, .bmp, .tga, .pxr, .raw. Omit to save in place |
format | string | JPEG: baseline, optimized (default) or progressive |
interlaced | boolean | PNG: interlaced |
layers | boolean | PSD, TIFF, PDF: keep layers |
notes | boolean | PSD, TIFF, PDF: save the document's notes with it (the Notes save option) |
options | object | More options for the format. TIFF: pixelOrder (interleaved|per_channel); byteOrder (ibm|mac); imagePyramid (true/false); layerCompression (rle|zip); jpegQuality (integer 0-12): with compression jpeg;… |
preserveEditing | boolean | PDF: keep Photoshop editing capabilities |
preset | string | PDF: Adobe PDF preset name, e.g. "[High Quality Print]" |
quality | integer | JPEG quality, 0-12. Default 10 |
spotColors | boolean | PSD: keep spot channels |
standard | string | PDF: PDF/X standard |
transparency | boolean | TIFF: keep transparency |
duplicate_document Duplicate Document
Duplicate the active document (Image > Duplicate), optionally merged into one layer
| Parameter | Type | Description |
|---|---|---|
mergeLayers | boolean | Duplicate merged layers only. Default false |
name | string |
set_active_document Set Active Document
Bring an open document to the front by name or index
| Parameter | Type | Description |
|---|---|---|
index | integer | |
name | string |
close_document Close Document
Close the active document. Unsaved changes are discarded unless save is true
| Parameter | Type | Description |
|---|---|---|
save | boolean | Save before closing. Default false |
set_colors Set Colors
Set the foreground and background colours used by fills, strokes, brushes and new documents
| Parameter | Type | Description |
|---|---|---|
background | string | "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)" |
foreground | string | "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)" |
resize_image Resize Image
Resize the image (Image > Image Size): width and/or height in pixels (the other follows the aspect ratio when omitted), resolution, and the resampling method, with noise reduction for Preserve Details and optionally scaling layer styles (Scale Styles). With resample "none", only the resolution changes and the pixels stay as they are
| Parameter | Type | Description |
|---|---|---|
height | number | Pixels |
reduceNoise | number | Reduce Noise for resample "preserve_details", 0-100 |
resample | string | Default automatic |
resolution | number | Pixels per inch |
scale | number | Percent of the current size, instead of width and height |
scaleStyles | boolean | Scale layer styles with the image (Scale Styles). Given either way, the resize runs through the Image Size command; the aspect ratio is kept, so give width, height or scale, not both width and height |
width | number | Pixels |
resize_canvas Resize Canvas
Change the canvas size (Image > Canvas Size) in pixels, keeping the image anchored at a side or corner. New areas take the Canvas Extension Color on a background layer (the background colour unless extensionColor is given) and stay transparent elsewhere
| Parameter | Type | Description |
|---|---|---|
anchor | string | Default center |
extensionColor | string | Canvas Extension Color for new areas of a background layer. Default: the background colour |
height | number | Pixels (added to the current height when relative) |
relative | boolean | Width and height are added to the current size. Default false |
width | number | Pixels (added to the current width when relative) |
crop_image Crop Image
Crop the image to a rectangle (Image > Crop, or the Crop tool), optionally rotating the crop and resampling the result to a size. Bounds reaching outside the canvas extend it, as dragging the Crop tool past the edge does
| Parameter | Type | Description |
|---|---|---|
bounds * | object | A rectangle in pixels from the document's top-left corner |
angle | number | Rotate the crop, in degrees |
height | number | Resample the result to this height in pixels |
width | number | Resample the result to this width in pixels |
trim_image Trim Image
Trim away transparent pixels, or pixels the colour of the top-left or bottom-right corner, from any of the four sides (Image > Trim)
| Parameter | Type | Description |
|---|---|---|
basedOn | string | Default transparent |
bottom | boolean | |
left | boolean | |
right | boolean | |
top | boolean |
rotate_canvas Rotate Canvas
Rotate the whole image by an angle in degrees (Image > Image Rotation); positive is clockwise. Or flip the canvas horizontally or vertically
| Parameter | Type | Description |
|---|---|---|
angle | number | |
flip | string |
change_mode Change Mode
Convert the image to another colour mode (Image > Mode): RGB, CMYK, Grayscale, Lab, Bitmap, Indexed Color or Multichannel, and/or another bit depth. Indexed Color takes the palette, colours, forced colours, transparency, matte and dither of its dialog; Bitmap (from Grayscale) takes the method, output resolution and halftone screen. Returns the document with its mode. Converting can flatten or discard information
| Parameter | Type | Description |
|---|---|---|
bitmap | object | Bitmap options (mode "bitmap"; the image must be Grayscale) |
bitsPerChannel | integer | |
indexed | object | Indexed Color options (mode "indexed") |
mode | string |
convert_profile Convert Profile
Convert the image to another colour profile (Edit > Convert to Profile) with a rendering intent, black point compensation and dither
| Parameter | Type | Description |
|---|---|---|
profile * | string | Destination profile name, e.g. "sRGB IEC61966-2.1", "Working CMYK" |
blackPointCompensation | boolean | |
dither | boolean | |
intent | string | Default relative_colorimetric |
flatten_image Flatten Image
Flatten every layer into a background layer (Layer > Flatten Image), or merge only the visible layers (Merge Visible)
| Parameter | Type | Description |
|---|---|---|
visibleOnly | boolean | Merge visible layers only. Default false |
reveal_all Reveal All
Enlarge the canvas to show every pixel that extends beyond it (Image > Reveal All)
set_color_table Set Color Table
Replace the colour table of an Indexed Color image (Image > Mode > Color Table) with a list of colours, in table order
| Parameter | Type | Description |
|---|---|---|
colors * | array | Up to 256 colours; each is stored as RGB |
set_pixel_aspect_ratio Set Pixel Aspect Ratio
Set the document's pixel aspect ratio (View > Pixel Aspect Ratio), for video work with non-square pixels, and/or toggle View > Pixel Aspect Ratio Correction, which previews the image with those pixels
| Parameter | Type | Description |
|---|---|---|
ratio | number | Pixel width divided by height: 1 is square, e.g. 0.91 for D1/DV NTSC, 1.09 for D1/DV PAL, 2 for anamorphic 2:1 |
toggleCorrection | boolean | Toggle Pixel Aspect Ratio Correction (on if it was off, off if it was on) |
get_histogram Get Histogram
Read the histogram (Histogram panel) of the composite image or of one channel: the pixel count at each of the 256 levels, with the total, mean and median
| Parameter | Type | Description |
|---|---|---|
channel | string | Channel name, e.g. "Red" or an alpha channel (list_channels). Default the composite |
list_layers List Layers
List the layers and groups, top to bottom, with id, name, kind (pixel, text, smart object, adjustment, shape...), visibility, opacity, blend mode, lock, bounds in pixels and parent group. Ids are what other tools take in target.ids
| Parameter | Type | Description |
|---|---|---|
depth | integer | How many group levels to descend. Default all |
group | integer | Only inside this group (id) |
create_layer Create Layer
Add a new empty pixel layer or a group above the active layer, or inside a group
| Parameter | Type | Description |
|---|---|---|
blendMode | string | |
fillOpacity | number | Fill opacity: affects pixels but not layer styles |
group | integer | Create inside this group (id) |
name | string | |
opacity | number | |
type | string | Default layer |
visible | boolean |
set_layer_properties Set Layer Properties
Rename layers and set their opacity, fill opacity, blend mode, visibility and locks
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
blendMode | string | |
fillOpacity | number | Fill opacity: affects pixels but not layer styles |
lockPixels | boolean | Lock image pixels (pixel layers) |
lockPosition | boolean | Lock position (pixel layers) |
lockTransparency | boolean | Lock transparent pixels (pixel layers) |
locked | boolean | Lock all |
name | string | |
opacity | number | |
visible | boolean |
set_active_layer Set Active Layer
Make a layer the active one; many commands work on the active layer
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
arrange_layers Arrange Layers
Change the stacking order: bring to front, bring forward, send backward, send to back, or place above, below or inside another layer or group
| Parameter | Type | Description |
|---|---|---|
order * | string | |
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
relativeTo | integer | Layer or group id, for above, below and inside |
group_layers Group Layers
Put layers into a new group (Layer > Group Layers), placed where the first of them was; they keep the order given
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
name | string |
ungroup_layers Ungroup Layers
Move a group's layers out to where the group was and remove the empty group (Layer > Ungroup Layers)
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
duplicate_layers Duplicate Layers
Duplicate layers or groups (Layer > Duplicate Layer), placed above each original, optionally renamed
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
name | string | Name for the copy (one layer only) |
delete_layers Delete Layers
Delete layers or groups (with everything inside them)
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
merge_layers Merge Layers
Merge a layer into the one below (Merge Down), or merge a group into one layer (Merge Group)
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
transform_layers Transform Layers
Move layers by dx, dy pixels, scale them by a percentage, rotate them by degrees, or flip them, around an anchor point; optionally transform a copy of each, keeping the original. Video layers transform the same way once they are Smart Objects
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
anchor | string | Default center |
angle | number | Degrees, clockwise |
duplicate | boolean | Transform a copy of each layer, placed above it. Default false |
dx | number | |
dy | number | |
flip | string | |
scaleX | number | Percent; negative flips |
scaleY | number | Percent; negative flips |
rasterize_layers Rasterize Layers
Rasterize type, shape, smart object or fill layers into pixels (Layer > Rasterize), or only one part of them
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
what | string | Default entire_layer |
link_layers Link Layers
Link layers together so they move and transform as one, or unlink them
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
unlink | boolean |
convert_background_layer Convert Background Layer
Turn the background layer into a normal layer that can move and hold transparency, or make a layer the background
| Parameter | Type | Description |
|---|---|---|
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
toBackground | boolean | Make the target the background layer. Default false: turn the background into a normal layer |
layer_comps Layer Comps
Work with layer comps (Layer Comps panel): list, create, apply, update (recapture) or delete one; apply the previous or next comp; change a comp's options (Layer Comp Options); duplicate a comp; go back to the Last Document State; or clear a comp's warning (Clear Layer Comp Warning; every comp when no name is given)
| Parameter | Type | Description |
|---|---|---|
action * | string | |
appearance | boolean | create, options: record layer appearance (layer styles) |
comment | string | create, options: the comp's comment |
name | string | The comp to act on (create: the new comp's name) |
newName | string | options: rename the comp to this; duplicate: name for the copy |
position | boolean | create, options: record layer position |
visibility | boolean | create, options: record layer visibility |
new_layer_via New Layer Via
Make a new layer from existing pixels (Layer > New): Layer via Copy copies the selected pixels (or the whole layer when nothing is selected) to a new layer; Layer via Cut moves the selected pixels to a new layer; Stamp Visible merges a copy of every visible layer into a new layer above the target and keeps the originals
| Parameter | Type | Description |
|---|---|---|
method * | string | |
name | string | Name for the new layer |
target | object | The one layer to copy or cut from, or to stamp above. Default the active layer |
set_layer_selection Set Layer Selection
Select several layers at once in the Layers panel, for commands that act on the selected layers: set or add to the selection, select All Layers, Deselect Layers, Select Linked Layers, Similar Layers (same kind as the target), or find layers whose names contain some text (Select menu). Returns the selected layers
| Parameter | Type | Description |
|---|---|---|
action * | string | set: select exactly the target layers; add: add them; all, none; linked and similar: start from the target layer; find: select layers whose name contains query |
query | string | find: text the layer name contains, ignoring case |
target | object | set and add: the layers; linked and similar: the layer to start from (default the active layer) |
process_all_layers Process All Layers
Run a command on every layer of the document: Delete Hidden Layers (Layers panel menu) or Rasterize All Layers (Layer > Rasterize > All Layers)
| Parameter | Type | Description |
|---|---|---|
action * | string |
lock_layers Lock Layers
Apply locks to layers, optionally to every layer inside the target groups (Layer > Lock Layers, Lock All Layers in Group). Locks not listed are turned off; an empty list unlocks
| Parameter | Type | Description |
|---|---|---|
locks * | array | all, pixels (image pixels), position, transparency (transparent pixels), artboard (prevent auto-nesting). [] unlocks |
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
includeGroupContents | boolean | Also lock every layer inside target groups |
set_layer_link_enabled Set Layer Link Enabled
Suspend a linked layer's link (the red X Shift-clicking the link icon shows) or restore it, without unlinking
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | false suspends the link, true restores it |
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
set_layers_panel_view Set Layers Panel View
Change what the Layers panel shows, without changing the document: Isolate Layers (show only the target layers), Remove from Isolation, or Collapse All Groups
| Parameter | Type | Description |
|---|---|---|
action * | string | |
target | object | isolate: the layers to show. Default the active layer |
reverse_layer_order Reverse Layer Order
Reverse the stacking order of two or more layers (Layer > Arrange > Reverse)
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
apply_matting Apply Matting
Clean the edge pixels of a pixel layer (Layer > Matting): Defringe (replace fringe colours over a width in pixels), Remove Black Matte, Remove White Matte, or Color Decontaminate
| Parameter | Type | Description |
|---|---|---|
method * | string | |
target | object | Pixel layers. Default the active layer |
width | number | defringe: width in pixels. Default 1 |
copy_layer_code Copy Layer Code
Copy CSS for shape and type layers (size, position, colours, gradients, shadows, type settings), or SVG markup for a shape layer, to the clipboard (Layers panel context menu: Copy CSS, Copy SVG)
| Parameter | Type | Description |
|---|---|---|
format * | string | |
target | object | Default the active layer |
edit_layer_mask Edit Layer Mask
Work with layer masks (Layer > Layer Mask and the Layers panel): add a mask (Reveal All, Hide All, Reveal Selection or Hide Selection), apply it to the pixels, delete it, disable or enable it, link or unlink it from the layer, invert it, target the mask or the layer content for editing, load the mask as a selection, or copy or move it to another layer
| Parameter | Type | Description |
|---|---|---|
action * | string | |
invert | boolean | load_selection: select the hidden area instead |
reveal | string | add: what the new mask shows. Default reveal_selection when there is a selection, otherwise reveal_all |
showAlone | boolean | target_mask: show the mask by itself in the document window |
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer |
to | integer | copy_to, move_to: id of the layer that receives the mask; it must not have one |
set_mask_properties Set Mask Properties
Set the Density (opacity) and Feather of a layer's layer mask, vector mask or smart-filter mask (Properties panel, masks)
| Parameter | Type | Description |
|---|---|---|
density | number | Percent |
feather | number | Pixels |
mask | string | Which mask. Default layer |
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer |
edit_vector_mask Edit Vector Mask
Work with vector masks (Layer > Vector Mask): make one from a path (Current Path), disable or enable it, or delete it. Rasterize a vector mask with rasterize_layers
| Parameter | Type | Description |
|---|---|---|
action * | string | |
path | string | create_from_path: the path's name in the Paths panel. Default the selected path or work path |
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer |
set_clipping_mask Set Clipping Mask
Clip layers to the layer below them (Layer > Create Clipping Mask), so they show only where it has pixels, or release them (Layer > Release Clipping Mask)
| Parameter | Type | Description |
|---|---|---|
action * | string | |
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
set_quick_mask Set Quick Mask
Turn Quick Mask Mode on (the selection becomes a red overlay that painting edits) or off (the overlay becomes the selection again)
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true enters Quick Mask Mode, false leaves it |
refine_mask Refine Mask
Refine a layer mask's edges as Select and Mask does, writing the result back to the layer mask. Without a mask, the current selection is refined into a new mask
| Parameter | Type | Description |
|---|---|---|
contrast | number | Percent. Default 0 |
feather | number | Pixels. Default 0 |
radius | number | Edge detection radius in pixels. Default 0 |
shiftEdge | number | Percent; negative moves the edge in. Default 0 |
smartRadius | boolean | Smart Radius |
smooth | integer | Default 0 |
target | object | One layer. Default the active layer |
mask_by_color_range Mask By Color Range
Make a layer's mask from a colour range (Properties panel, masks: Color Range): a sampled colour with a fuzziness, or a preset range such as reds, highlights or skin tones. Replaces the layer's existing mask
| Parameter | Type | Description |
|---|---|---|
color | string | sampled: the colour to keep. "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)" |
colors | string | Default sampled |
fuzziness | integer | sampled: how far from the colour still counts. Default 40 |
invert | boolean | Mask out the range instead of keeping it |
target | object | One layer. Default the active layer |
convert_to_smart_object Convert To Smart Object
Bundle layers into one embedded smart object (Layer > Smart Objects > Convert to Smart Object), or convert a layer so filters applied to it stay editable as Smart Filters (Filter > Convert for Smart Filters)
| Parameter | Type | Description |
|---|---|---|
name | string | Name for the smart object layer |
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer |
get_smart_object_info Get Smart Object Info
Describe smart object layers: whether they are linked or embedded, their source file, the layer comps of the placed document and which one shows, and their Smart Filters in order with whether each is on
| Parameter | Type | Description |
|---|---|---|
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer |
edit_smart_object Edit Smart Object
Smart object commands (Layer > Smart Objects): New Smart Object via Copy, Edit Contents (opens the source as the active document; save and close it to update the layer), Replace Contents, Export Contents, Relink to File (also resolves a broken link), Update Modified Content, Update All Modified Content, Embed Linked, Embed All Linked, Convert to Linked, Reset Transform, Convert to Layers, and choosing which layer comp of the placed document shows (Properties panel)
| Parameter | Type | Description |
|---|---|---|
action * | string | |
comp | string | set_layer_comp: name of a layer comp in the placed document (get_smart_object_info lists them) |
file | string | Absolute path. replace_contents and relink: the source file to use; export_contents and convert_to_linked: the file to write |
page | integer | replace_contents: page of a multi-page file (PDF, Illustrator) |
target | object | One smart object layer. Default the active layer |
set_stack_mode Set Stack Mode
Render a multi-layer smart object with a statistical stack mode (Layer > Smart Objects > Stack Mode), for example median to remove moving objects or mean to reduce noise. Give several aligned layers and they are first converted into one smart object (an image stack)
| Parameter | Type | Description |
|---|---|---|
mode * | string | |
target | object | A smart object, or the layers to stack. Default the active layer |
set_smart_filter_visibility Set Smart Filter Visibility
Turn one Smart Filter on a smart object, or all of them, off or on (the eye icons under the layer in the Layers panel)
| Parameter | Type | Description |
|---|---|---|
visible * | boolean | true shows, false hides |
index | integer | Which filter, 1 = the first listed by get_smart_object_info. Default all |
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer |
set_layer_effects Set Layer Effects
Add, change, hide or remove layer style effects (Layer > Layer Style), as the Layer Style dialog does. effects maps each effect to an options object (omitted options keep the current settings, or Photoshop's defaults for a new effect), true (add or keep with defaults), false (delete the effect), or for dropShadow, innerShadow, colorOverlay, gradientOverlay and stroke a list (several instances, each from defaults). enabled: false hides one effect. Options by effect: dropShadow (enabled, blendMode, color, opacity, angle, useGlobalLight, distance, spread, size, contour, antiAlias, noise, knocksOu…
| Parameter | Type | Description |
|---|---|---|
effects * | object | For example { dropShadow: { distance: 8, size: 12 }, stroke: { size: 2, color: "#FFFFFF" }, outerGlow: false } |
replace | boolean | Start from an empty style, dropping effects not given |
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer |
get_layer_effects Get Layer Effects
Describe layers' styles: whether effects are shown, and each effect and instance with whether it is on and, with detail, all its settings
| Parameter | Type | Description |
|---|---|---|
detail | boolean | Include every setting of each effect |
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer |
copy_layer_style Copy Layer Style
Copy one layer's style to other layers (Layer > Layer Style > Copy Layer Style, then Paste Layer Style, which replaces their styles), or copy only some effects, added to their own styles as Option/Alt-dragging an effect does
| Parameter | Type | Description |
|---|---|---|
source * | object | The one layer to copy from |
target * | object | The layers to paste onto |
effects | array | Copy only these effects (every instance), replacing the same effects on the targets. Default the whole style |
manage_layer_style Manage Layer Style
Layer style commands (Layer > Layer Style): Clear Layer Style, Rasterize Layer Style (bake the effects into pixels), Scale Effects by a percentage, or hide or show all of a layer's effects
| Parameter | Type | Description |
|---|---|---|
action * | string | |
scale | number | scale: percent |
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default the active layer |
set_blending_options Set Blending Options
Set a layer's Blending Options (Layer Style dialog): blend mode, opacity and fill opacity; Advanced Blending knockout, the channels it blends into and the group options (Blend Interior Effects as Group, Blend Clipped Layers as Group, Transparency Shapes Layer, Layer Mask Hides Effects, Vector Mask Hides Effects); and Blend If ranges for this layer and the underlying layer
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
blendClippedLayers | boolean | blend clipped layers |
blendIf | array | Blend If, one entry per channel: { channel: "gray" or a colour channel, thisLayer: [black, black split, white split, white], underlyingLayer: [...] }, levels 0-255 |
blendInteriorEffects | boolean | blend interior effects |
blendMode | string | Blend mode |
channels | array | Channels the layer blends into, e.g. ["red", "blue"]; the document's own channel names |
fillOpacity | number | Fill opacity, percent (pixel, type and shape layers) |
knockout | string | Knockout |
layerMaskHidesEffects | boolean | layer mask hides effects |
opacity | number | Percent |
transparencyShapesLayer | boolean | transparency shapes layer |
vectorMaskHidesEffects | boolean | vector mask hides effects |
manage_style_presets Manage Style Presets
Use the Styles panel: apply a loaded style preset to layers by name (replacing their styles), load a style library (.asl) into the panel, or save the panel's styles as a library (Styles panel menu: Load Styles, Save Styles)
| Parameter | Type | Description |
|---|---|---|
action * | string | |
append | boolean | load: add to the current styles (false replaces them) |
file | string | load, save: absolute path of the .asl file |
style | string | apply: the style's name in the Styles panel |
target | object | apply: the layers. Default the active layer |
select_area Select Area
Select a rectangle, an ellipse, a polygon or freehand outline (the Polygonal Lasso and Lasso tools), or a one-pixel row or column (Single Row and Single Column Marquee tools), in pixels from the document's top-left corner, combined with the current selection. The ellipse is a fine polygon, so its edge is close to but not exactly the Elliptical Marquee's
| Parameter | Type | Description |
|---|---|---|
antiAlias | boolean | |
bounds | object | Rectangle or ellipse bounds |
combine | string | How it combines with the current selection. Default replace |
feather | number | Pixels. Default 0 |
points | array | Polygon or lasso outline, [[x, y], ...] |
shape | string | Default rectangle |
x | number | column: the column's left edge, pixels from the left |
y | number | row: the row's top edge, pixels from the top |
select_all Select All
Select the whole canvas (Select > All), deselect (Select > Deselect), or invert the selection (Select > Inverse)
| Parameter | Type | Description |
|---|---|---|
action * | string |
modify_selection Modify Selection
Modify the selection (Select > Modify): expand, contract, feather, smooth or border by pixels; grow or select similar colours by tolerance
| Parameter | Type | Description |
|---|---|---|
amount * | number | Pixels (radius or width); tolerance 0-255 for grow and similar |
operation * | string |
transform_selection Transform Selection
Move, scale or rotate the selection outline (Select > Transform Selection), or the selected pixels themselves
| Parameter | Type | Description |
|---|---|---|
angle | number | |
dx | number | |
dy | number | |
pixels | boolean | Transform the selected pixels, not just the outline. Default false |
scaleX | number | Percent |
scaleY | number | Percent |
fill_selection Fill Selection
Fill the selection on the active layer with a colour (Edit > Fill), with a blend mode, opacity and optionally preserving transparency
| Parameter | Type | Description |
|---|---|---|
blendMode | string | Default normal |
color | string | "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)". Default the foreground colour |
opacity | number | |
preserveTransparency | boolean |
stroke_selection Stroke Selection
Stroke the selection's edge on the active layer (Edit > Stroke): colour, width in pixels, inside, centre or outside, blend mode and opacity
| Parameter | Type | Description |
|---|---|---|
width * | number | |
blendMode | string | Default normal |
color | string | "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)". Default the foreground colour |
location | string | Default center |
opacity | number | |
preserveTransparency | boolean |
save_selection Save Selection
Store the selection in an alpha channel (Select > Save Selection), or load a channel as the selection (Select > Load Selection), combined with the current one
| Parameter | Type | Description |
|---|---|---|
action * | string | |
channel * | string | Alpha channel name. Saving to a new name creates the channel |
combine | string | How it combines with the current selection. Default replace |
invert | boolean | Load: invert the channel. Default false |
clipboard Clipboard
Copy, copy merged, cut or clear the selection on the active layer, or paste as a new layer: paste, paste_into the selection, paste_in_place (Edit > Paste Special > Paste in Place: at the copied pixels' original position) or paste_outside the selection (Paste Outside: the selection is masked out)
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do |
activate_tool Activate Tool
Choose a tool in the Tools panel, such as a marquee, lasso, Quick Selection, Magic Wand, Crop, Perspective Crop, Eyedropper, Color Sampler, Ruler or Count tool, so it is ready for the user. Using a tool on the canvas is the user's; select_area, crop_image and manage_count_items do the same work by numbers
| Parameter | Type | Description |
|---|---|---|
tool * | string |
select_color_range Select Color Range
Select by colour (Select > Color Range): pixels near a sampled colour within a fuzziness, or a preset range (reds ... magentas, highlights, midtones, shadows, out of gamut), optionally inverted. Works inside the current selection when there is one, and samples the active layer
| Parameter | Type | Description |
|---|---|---|
color | string | The colour to select (Sampled Colors). "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)" |
fuzziness | integer | Sampled colours and highlights/midtones/shadows: how far from the colour or tone still counts. Default 40 |
invert | boolean | Select everything else. Default false |
preset | string | A preset range instead of a colour |
range | array | highlights, midtones or shadows: the [lower, upper] tonal limits, 0-255 |
select_content Select Content
Select automatically: the main subject (Select > Subject), the sky (Select > Sky), or the in-focus areas with Focus Area's automatic settings (Select > Focus Area). Subject uses the device or cloud processing chosen in Preferences > Image Processing
| Parameter | Type | Description |
|---|---|---|
what * | string | |
sampleAllLayers | boolean | subject and sky: look at every layer, not only the active one. Default false |
refine_selection Refine Selection
Refine the selection's edge as Select and Mask does, without opening the workspace: edge detection radius (optionally smart), smooth, feather, contrast, shift edge and colour decontamination, output to the selection, a layer mask, a new layer or a new document
| Parameter | Type | Description |
|---|---|---|
contrast | number | Percent. Default 0 |
decontaminate | boolean | Decontaminate Colors (needs an output to a new layer or document). Default false |
decontaminateAmount | number | Percent. Default 100 |
feather | number | Pixels. Default 0 |
output | string | Default selection |
radius | integer | Edge detection radius, pixels. Default 0 |
sampleAllLayers | boolean | Default false |
shiftEdge | number | Percent; negative moves the edge inward. Default 0 |
smartRadius | boolean | Smart Radius. Default false |
smooth | integer | Default 0 |
select_layer_pixels Select Layer Pixels
Load layers' transparency as the selection, as Cmd/Ctrl-clicking a layer thumbnail does: replace, add to, subtract from or intersect with the current selection. With several layers, replace selects all of their pixels together
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
combine | string | How it combines with the current selection. Default replace |
list_channels List Channels
List the Channels panel: each channel's name, kind (component, alpha masked or selected areas, spot colour), visibility, opacity or spot solidity, colour, and whether it is targeted
create_channel Create Channel
Add an alpha channel (Channels panel > New Channel) whose colour shows masked or selected areas, or a spot colour channel (New Spot Channel) with its ink colour and solidity; optionally filled from the selection (Save Selection as Channel)
| Parameter | Type | Description |
|---|---|---|
color | string | Overlay colour of an alpha channel, or ink colour of a spot channel. "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "la… |
fromSelection | boolean | Fill the channel from the current selection. Default false |
kind | string | Default masked_areas (an alpha channel) |
name | string | Channel name; spot channels are usually named after the ink |
opacity | number | Overlay opacity of an alpha channel, or Solidity of a spot channel, percent |
set_channel Set Channel
Change a channel's options (Channels panel > Channel Options): name, kind (converting an alpha channel to a spot channel or back), colour, opacity or solidity, and show or hide it (the eye icon). Colour channels such as Red can only be shown or hidden
| Parameter | Type | Description |
|---|---|---|
channel * | string | The channel's current name (list_channels) |
color | string | "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)" |
kind | string | |
name | string | |
opacity | number | Percent |
visible | boolean |
manage_channels Manage Channels
Target channels for editing (clicking them in the Channels panel), duplicate a channel (into this or another open document), delete alpha or spot channels, or merge spot channels into the colour channels (Merge Spot Channel, which flattens the image)
| Parameter | Type | Description |
|---|---|---|
action * | string | |
channels * | array | Channel names (list_channels) |
name | string | duplicate: name for the copy (one channel) |
toDocument | string | duplicate: an open document of the same pixel size to copy into. Default this one |
split_channels Split Channels
Split the image into one grayscale document per channel (Channels panel > Split Channels). The original closes; the image must be flattened first (flatten_image)
merge_channels Merge Channels
Combine open grayscale documents of the same pixel size into one image (Channels panel > Merge Channels): three into RGB or Lab, four into CMYK, or two or more into Multichannel, in channel order (e.g. red, green, blue)
| Parameter | Type | Description |
|---|---|---|
documents * | array | Open grayscale document names, in channel order |
mode | string | Default rgb |
apply_image Apply Image
Blend a source layer and channel, from this or another open document of the same pixel size, into the active layer (Image > Apply Image), with a blending mode, opacity, invert and preserve transparency; add and subtract take scale and offset. Works inside the selection when there is one
| Parameter | Type | Description |
|---|---|---|
blendMode | string | Default normal |
offset | integer | add and subtract: add this brightness. Default 0 |
opacity | number | Percent. Default 100 |
preserveTransparency | boolean | Default false |
scale | number | add and subtract: divide the result by this. Default 1 |
source | object | A source channel |
target | object | The layer to change. Default the active layer |
calculate_channels Calculate Channels
Blend two source channels into a new alpha channel (Image > Calculations): each source is a layer (or merged) and channel, from this or another open document of the same pixel size, optionally inverted; with a blending mode and opacity
| Parameter | Type | Description |
|---|---|---|
source1 * | object | A source channel |
source2 * | object | A source channel |
blendMode | string | Default multiply |
name | string | Name for the new channel |
opacity | number | Percent. Default 100 |
align_layers Align Layers
Align layers by their top, vertical centre, bottom, left, horizontal centre or right edges (Layer > Align), or distribute them evenly by those edges (Layer > Distribute; three or more layers). With toSelection, align them to the selection (Layer > Align Layers To Selection)
| Parameter | Type | Description |
|---|---|---|
edge * | string | |
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
distribute | boolean | Distribute instead of align. Default false |
toSelection | boolean | Align to the current selection. Default false; Photoshop aligns to a selection whenever there is one, so without toSelection the call refuses when something is selected |
auto_align_layers Auto Align Layers
Line up overlapping photos of the same scene (Edit > Auto-Align Layers) by their content, with the Auto or Perspective projection, optionally removing vignetting and correcting geometric distortion. Pixel layers only: not adjustment, vector or Smart Object layers
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
geometricDistortion | boolean | Geometric Distortion correction. Default false |
projection | string | Default auto |
removeVignette | boolean | Vignette Removal. Default false |
auto_blend_layers Auto Blend Layers
Blend aligned layers into one seamless image (Edit > Auto-Blend Layers): a panorama, or a focus stack that keeps the sharpest areas of each layer, with Seamless Tones and Colors. RGB or Grayscale; not for Smart Objects, video, 3D or the background layer
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
method | string | Default panorama |
seamlessTones | boolean | Seamless Tones and Colors. Default true |
apply_transform Apply Transform
Transform layers or a path numerically, as Free Transform's options bar does: move, scale, rotate and skew (Edit > Transform > Skew) around a reference point; repeat the last transform (Edit > Transform > Again); or transform a duplicate, keeping the original. With path, transforms the path's points (Edit > Transform Path)
| Parameter | Type | Description |
|---|---|---|
again | boolean | Repeat the last transform instead of giving values (Transform Again) |
anchor | string | Reference point. Default center |
angle | number | Degrees, clockwise |
duplicate | boolean | Layers: transform a copy of each layer, placed above it. Default false |
dx | number | Move right, pixels |
dy | number | Move down, pixels |
path | string | A path name (Paths panel) to transform instead of layers |
scaleX | number | Width, percent; negative flips |
scaleY | number | Height, percent; negative flips |
skewX | number | Horizontal skew, degrees |
skewY | number | Vertical skew, degrees |
target | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Each layer transforms around its own reference point |
warp_layers Warp Layers
Warp layers with a preset style (Edit > Transform > Warp): arc, arch, bulge, flag, wave, fisheye, twist and the rest, with bend and horizontal and vertical distortion in percent, horizontal or vertical. Warping a Smart Object stays editable
| Parameter | Type | Description |
|---|---|---|
style * | string | |
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
bend | number | Percent. Default 50 |
horizontalDistortion | number | Percent. Default 0 |
orientation | string | Default horizontal |
verticalDistortion | number | Percent. Default 0 |
warp_perspective Warp Perspective
Correct or change a layer's perspective (Edit > Perspective Warp) with one quad: four corners in the image move to four new positions, e.g. to square up a photographed sign. Corners go top-left, top-right, bottom-right, bottom-left, in pixels. Needs the graphics processor enabled
| Parameter | Type | Description |
|---|---|---|
from * | array | The quad's corners in the image now, [[x, y] x 4] |
target * | object | One layer |
to * | array | Where those corners go, [[x, y] x 4] |
scale_content_aware Scale Content Aware
Resize a layer while keeping important content such as people and buildings unchanged (Edit > Content-Aware Scale): width and height in percent, the Amount of content-aware against normal scaling, Protect Skin Tones, and an alpha channel to protect
| Parameter | Type | Description |
|---|---|---|
target * | object | One layer |
amount | number | Percent of content-aware scaling. Default 100 |
anchor | string | Reference point. Default center |
protectChannel | string | Alpha channel whose white areas are protected (list_channels) |
protectSkinTones | boolean | Default false |
scaleX | number | Width, percent. Default 100 |
scaleY | number | Height, percent. Default 100 |
set_measurement_scale Set Measurement Scale
Set the document's measurement scale (Image > Analysis > Set Measurement Scale): how many pixels make a length in logical units, e.g. 100 pixels = 2 millimeters. Without arguments, returns the current scale
| Parameter | Type | Description |
|---|---|---|
logicalLength | number | The length those pixels stand for |
logicalUnits | string | Unit name, e.g. "mm", "microns", "km" |
name | string | Name for this scale preset |
pixelLength | number | Pixels |
reset | boolean | Reset to the default: 1 pixel = 1 pixel |
record_measurements Record Measurements
Record measurements to the Measurement Log (Image > Analysis > Record Measurements) from the selection, the Ruler tool's line or the Count tool's items, with a chosen set of data points. The ruler source needs a line drawn with the Ruler tool
| Parameter | Type | Description |
|---|---|---|
dataPoints | array | Data points (Image > Analysis > Select Data Points), by their names in the Measurement Log, e.g. "Area", "Perimeter", "Count", "Length", "Angle". Default: the current choice |
source | string | What to measure. Default selection |
manage_measurement_log Manage Measurement Log
Work with the Measurement Log panel (Window > Measurement Log): export all or the selected measurements to a tab-delimited text file, delete them, select or deselect all rows, toggle Auto Display Panel, or show or hide the panel
| Parameter | Type | Description |
|---|---|---|
action * | string | |
dataPoints | array | Data points (Image > Analysis > Select Data Points), by their names in the Measurement Log, e.g. "Area", "Perimeter", "Count", "Length", "Angle". Default: the current choice |
filePath | string | export: absolute path of a .txt or .csv file |
range | string | export and delete: all rows or the selected ones. Default all |
manage_count_items Manage Count Items
List, add, remove or clear the Count tool's numbered markers (count items) in the document. Positions are pixels from the top-left corner; indexes start at 0
| Parameter | Type | Description |
|---|---|---|
action * | string | |
index | integer | remove: the count item's index |
points | array | add: positions, [[x, y], ...] |
adjust_layers Adjust Layers
Apply an Image > Adjustments command to pixel layers (inside the selection, if there is one). This changes the pixels; it does not add an adjustment layer. auto_color_correction applies Auto with an algorithm from Auto Color Correction Options, once; match_color adjusts the layer on its own (Match Color with Source: None, RGB only); replace_color changes one colour and the colours within its fuzziness (Replace Color). Options by type: brightness_contrast (brightness, contrast, useLegacy); levels (inputBlack, inputWhite, gamma, outputBlack, outputWhite, channel, auto); curves (points, channel);…
| Parameter | Type | Description |
|---|---|---|
adjustment * | string | |
options | object | Settings for the chosen type; omitted settings use the defaults Photoshop opens its dialog with |
target | object | Pixel layers. Default the active layer |
apply_filter Apply Filter
Apply a filter from the Filter menu to pixel layers (inside the selection, if there is one). The Filter Gallery filters (Artistic, Brush Strokes, Sketch, Texture, glowing_edges), filter_gallery (the whole gallery stack), shape_blur, mezzotint and adaptive_wide_angle have no options here: they use the settings last used in their dialog or the Filter Gallery. diffuse, extrude and lens_correction (Filter > Lens Correction) apply only the settings given; the rest keep the values last used in the dialog. Filters without an object-model method act through the active layer, which ends on the last tar…
| Parameter | Type | Description |
|---|---|---|
filter * | string | |
options | object | Settings for the chosen type; omitted settings use the defaults Photoshop opens its dialog with |
target | object | Pixel layers. Default the active layer |
create_adjustment_layer Create Adjustment Layer
Add an adjustment layer above the active layer (Layer > New Adjustment Layer, or the Adjustments panel), with its settings, optionally clipped to the layer below. Adjustment layers change the look of the layers beneath without changing their pixels. Options by type: brightness_contrast (brightness, contrast, useLegacy); levels (channel, inputBlack, inputWhite, gamma, outputBlack, outputWhite, auto); curves (channel, points); exposure (exposure, offset, gamma); vibrance (vibrance, saturation); color_and_vibrance (temperature, tint, vibrance, saturation); hue_saturation (hue, saturation, lightne…
| Parameter | Type | Description |
|---|---|---|
type * | string | Adjustment type |
above | object | Add it above this layer (the first match) instead of the active layer |
blendMode | string | Blend mode |
clip | boolean | Use Previous Layer to Create Clipping Mask: affect only the layer below |
name | string | Layer name. Default Photoshop's (e.g. "Levels 1") |
opacity | number | Layer opacity, percent |
options | object | Settings for the chosen type; see the list in this tool's description. Omitted settings use Photoshop's defaults |
edit_adjustment_layer Edit Adjustment Layer
Change the settings of existing adjustment layers (the Properties panel). Only the options given change; the rest keep their values. Also sets name, opacity, blend mode and clipping. Options by type: brightness_contrast (brightness, contrast, useLegacy); levels (channel, inputBlack, inputWhite, gamma, outputBlack, outputWhite, auto); curves (channel, points); exposure (exposure, offset, gamma); vibrance (vibrance, saturation); color_and_vibrance (temperature, tint, vibrance, saturation); hue_saturation (hue, saturation, lightness, colorize, ranges); color_balance (shadows, midtones, highlights…
| Parameter | Type | Description |
|---|---|---|
target * | object | Adjustment layers of the given type |
type * | string | Their adjustment type |
blendMode | string | Blend mode |
clip | boolean | Use Previous Layer to Create Clipping Mask: affect only the layer below |
name | string | Layer name. Default Photoshop's (e.g. "Levels 1") |
opacity | number | Layer opacity, percent |
options | object | Settings for the chosen type; see the list in this tool's description. Omitted settings use Photoshop's defaults |
create_fill_layer Create Fill Layer
Add a fill layer above the active layer (Layer > New Fill Layer): a solid colour, a gradient (defined as in the Gradient Editor) or a pattern, optionally clipped to the layer below. Options by type: solid_color (color); gradient (gradient, style, angle, scale, reverse, dither, alignWithLayer, method, offset); pattern (pattern, patternId, scale, linked).
| Parameter | Type | Description |
|---|---|---|
type * | string | Fill type |
above | object | Add it above this layer (the first match) instead of the active layer |
blendMode | string | Blend mode |
clip | boolean | Use Previous Layer to Create Clipping Mask: affect only the layer below |
name | string | Layer name. Default Photoshop's (e.g. "Levels 1") |
opacity | number | Layer opacity, percent |
options | object | Settings for the chosen fill. solid_color needs color; pattern needs pattern (a name); see the list in this tool's description. Omitted settings use Photoshop's defaults |
edit_fill_layer Edit Fill Layer
Change existing fill layers: colour, gradient and its placement, or pattern (double-clicking the layer thumbnail). Only the options given change. Options by type: solid_color (color); gradient (gradient, style, angle, scale, reverse, dither, alignWithLayer, method, offset); pattern (pattern, patternId, scale, linked).
| Parameter | Type | Description |
|---|---|---|
target * | object | Fill layers of the given type |
type * | string | Their fill type |
blendMode | string | Blend mode |
clip | boolean | Use Previous Layer to Create Clipping Mask: affect only the layer below |
name | string | Layer name. Default Photoshop's (e.g. "Levels 1") |
opacity | number | Layer opacity, percent |
options | object | Settings for the chosen fill; see the list in this tool's description. Omitted settings use Photoshop's defaults |
swap_colors Swap Colors
Switch the foreground and background colours (Switch Foreground and Background Colors, X), or with reset: true return them to black and white (Default Foreground and Background Colors, D)
| Parameter | Type | Description |
|---|---|---|
reset | boolean | Reset to black foreground and white background instead of switching. Default false |
pick_color Pick Color
Work with a colour the way the Color Picker and Color panel do: give a colour in any model (or read the current foreground or background colour) and get its HSB, RGB, Lab, CMYK, grayscale and hex values, whether it is web-safe and the nearest web-safe colour (Only Web Colors); optionally snap it to web-safe and make it the foreground or background colour
| Parameter | Type | Description |
|---|---|---|
color | string | The colour. "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)" |
from | string | Use the current foreground or background colour instead of color |
setAs | string | Make the result the foreground or background colour |
webSafe | boolean | Snap to the nearest web-safe colour (Only Web Colors) |
sample_color Sample Color
Read pixel colours of the composite image at points (Color Sampler tool and Info panel), optionally making the first the foreground or background colour (Eyedropper tool) and keeping the samplers in the document
| Parameter | Type | Description |
|---|---|---|
points * | array | Pixel positions from the document's top-left |
clear | boolean | Remove the document's existing colour samplers first. Default false |
keep | boolean | Leave colour samplers at the points. Default false |
setAs | string | Make the first sampled colour the foreground or background colour (Eyedropper) |
define_pattern Define Pattern
Save the selection, an area or the whole image as a pattern (Edit > Define Pattern), for pattern fill layers and fills. The area must be a plain rectangle; without one, the selection is used, or the whole image when nothing is selected
| Parameter | Type | Description |
|---|---|---|
name * | string | Pattern name |
bounds | object | Rectangle to use, in pixels; selected first and deselected afterwards |
assign_profile Assign Profile
Assign a colour profile to the active document without converting its colour values (Edit > Assign Profile): a profile name, the working space, or none (Don't Color Manage). Use convert_profile to keep the appearance instead
| Parameter | Type | Description |
|---|---|---|
profile * | string | Profile name, e.g. "Adobe RGB (1998)", or "working" for the working space, or "none" |
set_color_preferences Set Color Preferences
Choose the colour settings file (Edit > Color Settings, e.g. "North America General Purpose 2"), Dynamic Color Sliders (Color panel) and the Gamut Warning opacity (Preferences > Transparency & Gamut); returns the current values. With no arguments it only reads them
| Parameter | Type | Description |
|---|---|---|
dynamicColorSliders | boolean | Dynamic Color Sliders |
gamutWarningOpacity | number | Gamut Warning opacity, percent |
settings | string | Name of a colour settings file (as in the Color Settings Settings menu) |
set_proof_view Set Proof View
Soft-proof the active document: choose a Proof Setup preset (View > Proof Setup: working CMYK or one plate, legacy Mac RGB, sRGB, monitor RGB, colour-blindness types), and toggle View > Proof Colors and View > Gamut Warning. The toggles switch the current state, which scripts cannot read
| Parameter | Type | Description |
|---|---|---|
preset | string | Proof Setup preset |
toggleGamutWarning | boolean | Toggle Gamut Warning |
toggleProofColors | boolean | Toggle Proof Colors |
repeat_last_filter Repeat Last Filter
Apply the last filter again, with the same settings, to layers (Filter > Last Filter). A filter must have been applied in this Photoshop session
| Parameter | Type | Description |
|---|---|---|
target | object | Layers. Default the active layer |
fade_filter Fade Filter
Fade the filter, adjustment or paint stroke just applied: blend it with what was there before at an opacity and blend mode (Edit > Fade). Only works directly after that edit
| Parameter | Type | Description |
|---|---|---|
opacity * | number | Percent of the edit to keep |
mode | string | Blend mode. Default normal |
fill_contents Fill Contents
Fill the selection (or the whole layer when nothing is selected) on the active layer with the foreground or background colour, black, 50% gray, white, a pattern, a History state, or Content-Aware fill (Edit > Fill). A pattern fill can run one of the scripted patterns Photoshop ships (Edit > Fill > Pattern > Script: Brick Fill, Cross Weave, Place Along Path, Random Fill, Symmetry Fill) with its settings given here instead of in its dialog. Content-Aware needs a selection and fills it directly, without the Content-Aware Fill workspace. For a specific colour use fill_selection
| Parameter | Type | Description |
|---|---|---|
contents * | string | What to fill with; gray is 50% gray |
blendMode | string | Blend mode. Default normal |
colorAdaptation | boolean | Content-Aware: blend the fill's colour with its surroundings. Default true |
historyIndex | integer | History state to fill from (list_history), for contents history. Default 0, the opening state |
mirror | boolean | Content-Aware: allow mirrored samples. Default false |
opacity | number | Percent. Default 100 |
pattern | string | Pattern name (from the Patterns panel), for contents pattern |
preserveTransparency | boolean | Leave transparent pixels transparent. Default false |
rotationAdaptation | boolean | Content-Aware: allow rotated samples. Default false |
scale | boolean | Content-Aware: allow scaled samples. Default false |
script | string | Contents pattern: lay the pattern out with this scripted pattern (the Script option) |
scriptOptions | object | With script: the script's settings; any left out keep the script's defaults, and values beyond what the script allows are clamped. brick_fill: patternScale, spacing, offset, colorRandomness, brightnes… |
scriptPath | string | With script place_along_path (required) or random_fill: the path in the Paths panel to place the pattern along |
draw_gradient Draw Gradient
Draw a classic gradient on the active layer, inside the selection if there is one, from one point to another (Gradient tool in Classic gradient mode): linear, radial, angle, reflected or diamond, with colour and opacity stops, reverse, dither, transparency and interpolation. Without colours it runs from the foreground to the background colour
| Parameter | Type | Description |
|---|---|---|
from * | object | Start point, pixels from the top-left |
to * | object | End point, pixels from the top-left |
blendMode | string | Blend mode. Default normal |
colors | array | Colour stops. Default foreground to background |
dither | boolean | Dither to reduce banding. Default true |
interpolation | string | How colours blend between stops. Default perceptual |
opacities | array | Opacity stops. Default fully opaque throughout |
opacity | number | Percent. Default 100 |
reverse | boolean | Reverse the colour order. Default false |
transparency | boolean | Use the opacity stops (the Transparency option). Default true |
type | string | Default linear |
stroke_path Stroke Path
Paint along a path on the active layer with a painting or retouching tool, using that tool's current brush and options (Paths panel > Stroke Path). Give a path from the Paths panel or points for a temporary one. Set the brush first with set_tool_options. Clone Stamp and Healing Brush need cloneSource
| Parameter | Type | Description |
|---|---|---|
tool * | string | The tool to paint with |
cloneSource | object | Clone Stamp and Healing Brush: where to sample from, as Alt-clicking does |
closed | boolean | With points: close the temporary path. Default false |
path | string | Name of a path in the Paths panel |
points | array | Instead of path: corners of a temporary path, [[x, y], ...] in pixels. It is removed afterwards |
simulatePressure | boolean | Taper the stroke as if drawn with a pressure-sensitive pen. Default false |
fill_path Fill Path
Fill the area inside a path on the active layer with a colour (Paths panel > Fill Path), with blend mode, opacity, feather and anti-aliasing. Give a path from the Paths panel or points for a temporary one
| Parameter | Type | Description |
|---|---|---|
antiAlias | boolean | Default true |
blendMode | string | Default normal |
color | string | "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)". Default the foreground colour |
feather | number | Pixels. Default 0 |
opacity | number | Percent. Default 100 |
path | string | Name of a path in the Paths panel |
points | array | Instead of path: corners of a temporary path, [[x, y], ...] in pixels. It is removed afterwards |
preserveTransparency | boolean | Default false |
fill_at_point Fill At Point
Fill (Paint Bucket tool) or erase (Magic Eraser tool) the area of similar colour around a point on the active layer, within the selection if there is one. Erasing on the Background layer turns it into an ordinary layer, as the Magic Eraser does
| Parameter | Type | Description |
|---|---|---|
action * | string | |
x * | number | Pixels from the left |
y * | number | Pixels from the top |
antiAlias | boolean | Smooth the edge. Default true |
blendMode | string | Fill only. Default normal |
color | string | "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)". Fill only. Default the foreground colour |
contiguous | boolean | Only connected pixels. Default true |
opacity | number | Percent. Default 100 |
sampleAllLayers | boolean | Judge colours from all visible layers. Default false |
tolerance | integer | How different a colour may be and still be included. Default 32 |
set_tool_options Set Tool Options
Choose the active tool and set its options bar: a brush preset (Brushes panel or the Brush Preset picker), size, hardness, opacity, flow, blend mode, the tablet pressure buttons for size and opacity, Smoothing and its options (Pulled String Mode, Stroke Catch-up, Catch-up on Stroke End, Adjust for Zoom), the Mixer Brush's Wet, Mix and Sample All Layers, Tolerance and Contiguous (Color Replacement, Paint Bucket, Magic Eraser), and the painting cursor style (Preferences > Cursors). The Mixer Brush, Spot Healing Brush and Red Eye tools can be made active here; painting with them stays on the canv…
| Parameter | Type | Description |
|---|---|---|
adjustForZoom | boolean | Smoothing options: Adjust for Zoom |
catchUpOnStrokeEnd | boolean | Smoothing options: Catch-up on Stroke End |
contiguous | boolean | Contiguous (Paint Bucket, Magic Eraser) |
flow | integer | Tool flow, percent |
hardness | number | Brush hardness, percent |
mix | number | Mixer Brush: Mix, percent |
mode | string | Blend mode (options bar Mode) of a painting tool, the Paint Bucket or the Magic Eraser |
opacity | integer | Tool opacity, percent |
paintingCursors | string | How painting cursors look |
preset | string | Brush preset name, as the Brushes panel lists it |
pressureControlsOpacity | boolean | Options bar button: pen pressure controls opacity |
pressureControlsSize | boolean | Options bar button: pen pressure controls size, overriding the Brush Settings panel |
pulledStringMode | boolean | Smoothing options: Pulled String Mode |
sampleAllLayers | boolean | Sample All Layers (Mixer Brush and other tools that have it) |
size | number | Brush diameter in pixels |
smoothing | number | Stroke Smoothing, percent (options bar) |
strokeCatchUp | boolean | Smoothing options: Stroke Catch-up |
tolerance | number | Tolerance: percent (1-100) for the Color Replacement tool, 0-255 for the Paint Bucket and Magic Eraser |
tool | string | Tool to make active. Default the current tool |
wet | number | Mixer Brush: Wet, percent |
manage_brushes Manage Brushes
Brush presets and files (Brushes panel and its menu): load a brush file (.abr) as the current tool's brush (Import Brushes), save the current tool's brush to a file (Export Selected Brushes), define a preset from the selection, or the whole image when nothing is selected (Edit > Define Brush Preset), save the current brush and its settings as a new preset (New Brush Preset), rename or delete a preset, or restore the default brushes (Reset Brushes), replacing the current set or appending to it
| Parameter | Type | Description |
|---|---|---|
action * | string | |
append | boolean | Reset: add the default brushes to the current ones instead of replacing them. Default false |
filePath | string | Import or export: absolute path to a .abr file |
name | string | Define and new_preset: the new preset's name. Rename: the new name |
preset | string | Rename and delete: the preset's name, as the Brushes panel lists it |
retouch_selection Retouch Selection
Repair or move the selected area on the active pixel layer by an offset: patch it from nearby pixels (Patch tool, Normal or Content-Aware), or move or extend it and fill the gap (Content-Aware Move tool). Needs a selection; dx and dy are the drag in pixels
| Parameter | Type | Description |
|---|---|---|
dx * | number | Horizontal offset in pixels, positive to the right |
dy * | number | Vertical offset in pixels, positive downward |
method * | string | |
color | integer | How much colour blending, 0 to 10. Default 5 |
moveMode | string | Content-Aware Move: move the content, or extend (duplicate) it. Default move |
patchFrom | string | Patch: source repairs the selection with the pixels at the offset; destination copies the selection to the offset. Default source |
patchMode | string | Patch: how the patch blends. Default content_aware |
sampleAllLayers | boolean | Sample all visible layers. Default false |
structure | integer | How closely the result keeps existing image patterns, 1 (loose) to 7 (strict). Default 5 for patch, 4 for move |
transparent | boolean | Patch: blend the sampled texture transparently. Default false |
set_brush_settings Set Brush Settings
Set the current tool's brush in the Brush Settings panel (Window > Brush Settings): Brush Tip Shape (size, hardness, angle, roundness, spacing, flip), Shape Dynamics, Scattering, Texture, Dual Brush, Color Dynamics, Transfer and Brush Pose, each section's on/off switch, the jitters and their Control (fade, pen pressure, tilt, stylus wheel, direction, rotation), and the Noise, Wet Edges, Build-up, Smoothing and Protect Texture checkboxes; clearControls first turns every dynamics option off (Clear Brush Controls). Only the settings given change; one the tool lacks is an error. stroke_path paints…
set_clone_source_options Set Clone Source Options
Use the Clone Source panel (Window > Clone Source) and its menu: choose which of the five clone sources the Clone Stamp and Healing Brush use, reset the active source's scale and rotation (Reset Transform), and toggle the overlay options Show Overlay, Auto Hide, Clip to Brush Tip and Invert. The overlay toggles flip the current state, which Photoshop does not report to scripts. Set a source's sample point with stroke_path cloneSource; show the panel with show_photoshop_panels
| Parameter | Type | Description |
|---|---|---|
resetTransform | boolean | Reset the active source's offset scale and rotation (Reset Transform) |
source | integer | Clone source to make active, 1-5 |
toggle | array | Overlay options to toggle, in order |
create_text_layer Create Text Layer
Add a type layer: point type at a position, or paragraph type in a box (width and height), with its font, size, colour and formatting. Line breaks in text start new paragraphs
| Parameter | Type | Description |
|---|---|---|
text * | string | |
x * | number | Pixels from the left: the baseline start for point type, the box's left edge for paragraph type |
y * | number | Pixels from the top |
baselineShift | number | Pixels |
capitalization | string | |
color | string | "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)" |
fauxBold | boolean | |
fauxItalic | boolean | |
font | string | PostScript font name (list_fonts), e.g. "MyriadPro-Regular" |
height | number | Paragraph type: box height in pixels |
horizontalScale | number | Percent |
justification | string | |
leading | number | Pixels; turns auto leading off |
name | string | |
size | number | Pixels |
strikethrough | boolean | |
tracking | number | Thousandths of an em |
underline | boolean | |
verticalScale | number | Percent |
width | number | Paragraph type: box width in pixels |
set_text Set Text
Change a type layer's text and/or formatting (applied to the whole layer), its position, and its warp (Type > Warp Text)
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
baselineShift | number | Pixels |
capitalization | string | |
color | string | "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)" |
fauxBold | boolean | |
fauxItalic | boolean | |
font | string | PostScript font name (list_fonts), e.g. "MyriadPro-Regular" |
horizontalScale | number | Percent |
justification | string | |
leading | number | Pixels; turns auto leading off |
size | number | Pixels |
strikethrough | boolean | |
text | string | |
tracking | number | Thousandths of an em |
underline | boolean | |
verticalScale | number | Percent |
warp | string | |
warpBend | number | |
warpHorizontalDistortion | number | |
warpVerticalDistortion | number | |
x | number | |
y | number |
list_fonts List Fonts
List installed fonts with their PostScript name, family and style, filtered by a search string
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
query | string |
set_type_options Set Type Options
Set Character and Paragraph panel options on type layers: anti-aliasing, text and warp orientation (vertical type), kerning, language, No Break, OpenType ligatures and oldstyle figures, the paragraph type box size, indents, paragraph spacing, hyphenation, justification spacing, hanging punctuation and the composer
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
antiAlias | string | Anti-aliasing method (Type > Anti-Alias) |
boxHeight | number | Paragraph type: bounding box height in pixels |
boxWidth | number | Paragraph type: bounding box width in pixels |
composer | string | Adobe Every-line or Single-line Composer (Paragraph panel menu) |
discretionaryLigatures | boolean | OpenType Discretionary Ligatures (Character panel) |
firstLineIndent | number | Indent first line in pixels (Paragraph panel) |
hangingPunctuation | boolean | Roman Hanging Punctuation (Paragraph panel menu) |
hyphenate | boolean | Hyphenate (Paragraph panel) |
hyphenation | object | Hyphenation dialog (Paragraph panel menu > Hyphenation) |
justificationSpacing | object | Justification dialog (Paragraph panel menu > Justification) |
kerning | string | Kerning (Character panel): metrics, optical or manual |
language | string | Language for hyphenation and spelling (Character panel) |
leftIndent | number | Indent left margin in pixels (Paragraph panel) |
ligatures | boolean | OpenType Standard Ligatures (Character panel) |
noBreak | boolean | No Break: keep words from breaking at line ends (Character panel menu) |
oldStyle | boolean | OpenType Oldstyle figures (Character panel) |
orientation | string | Text orientation (Type > Orientation): vertical gives vertical type |
rightIndent | number | Indent right margin in pixels (Paragraph panel) |
spaceAfter | number | Add space after paragraph, pixels (Paragraph panel) |
spaceBefore | number | Add space before paragraph, pixels (Paragraph panel) |
warpOrientation | string | Orientation of the warp (Warp Text dialog) |
convert_type_layer Convert Type Layer
Convert type layers (Type menu): to paragraph or point type, to a shape layer (Convert to Shape), to a work path (Create Work Path, which replaces the current work path), or to a selection shaped like the text, as the Type Mask tools make
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
to * | string | What to convert the type into |
combine | string | selection: how the text outline combines with the current selection. Default replace |
removeLayer | boolean | selection: delete the type layers afterwards, leaving only the selection (as the Type Mask tools do). Default false |
find_replace_layer_text Find Replace Layer Text
Find and replace text in type layers (Edit > Find and Replace Text), keeping each layer's formatting. Searches every visible, unlocked type layer, or one layer. Line breaks in the replacement start new paragraphs
| Parameter | Type | Description |
|---|---|---|
find * | string | Text to find |
replace * | string | Replacement text; empty deletes the matches |
caseSensitive | boolean | Match case. Default false |
ignoreAccents | boolean | Ignore accents. Default false |
target | object | Search only this type layer instead of all of them (one layer) |
wholeWord | boolean | Whole words only. Default false |
fill_type_with_image Fill Type With Image
Fill type with an image: move an image layer directly above a type layer and clip it to the type (Layer > Create Clipping Mask), so the image shows only through the letters
| Parameter | Type | Description |
|---|---|---|
image * | object | The image layer to show through the type (one pixel or smart object layer) |
target * | object | The type layer (one layer) |
toggle_type_panels Toggle Type Panels
Show or hide a type panel (Window > Character, Paragraph, Character Styles or Paragraph Styles). Each call switches the panel between shown and hidden
| Parameter | Type | Description |
|---|---|---|
panel * | string | The panel to show or hide |
draw_vector_shape Draw Vector Shape
Draw with the shape and pen tools: rectangles (with rounded corners), ellipses, triangles, polygons, stars, lines, custom shape presets and pen points, combined with path operations. Mode shape makes a shape layer filled with a colour; path adds a path to the Paths panel; pixels fills the shape on the active layer
| Parameter | Type | Description |
|---|---|---|
components * | array | The shape's components, drawn in order; each one's operation combines it with those before it |
antiAlias | boolean | pixels: smooth the edges. Default true |
color | string | Fill colour for shape and pixels modes. Default: the foreground colour |
mode | string | Tool mode: shape layer (default), path, or pixels |
name | string | Name of the new shape layer, or of the new path (default "Path", numbered if taken) |
opacity | number | pixels: fill opacity percent. Default 100 |
list_paths List Paths
List the Paths panel: each path's index, name and kind (saved path, work path, clipping path, vector or type mask) and its number of components; optionally every component's anchor points and direction handles, in pixels
| Parameter | Type | Description |
|---|---|---|
path | string | Path name, as in the Paths panel (list_paths) |
pathIndex | integer | Path index from list_paths, instead of its name |
points | boolean | Include each component's operation, closed state and anchor points. Default false |
manage_paths Manage Paths
Paths panel commands: rename, duplicate or delete a path; select or deselect it (Path Selection); load it as a selection (Make Selection); make a work path from the selection (Make Work Path); make it the clipping path; fill or stroke it on the active layer; save it as a custom shape preset (Edit > Define Custom Shape); or show/hide the Paths panel
| Parameter | Type | Description |
|---|---|---|
action * | string | The command |
antiAlias | boolean | make_selection and fill: anti-aliased edges. Default true |
color | string | fill: colour. Default: the foreground colour |
combine | string | make_selection: how it combines with the current selection. Default replace |
feather | number | make_selection and fill: feather radius in pixels. Default 0 |
flatness | number | make_clipping_path: flatness in device pixels. Default: the printer's |
newName | string | rename: the new name; duplicate: the copy's name; define_custom_shape: the preset name |
opacity | number | fill: opacity percent. Default 100 |
path | string | Path name, as in the Paths panel (list_paths) |
pathIndex | integer | Path index from list_paths, instead of its name |
preserveTransparency | boolean | fill: leave transparent pixels transparent. Default false |
simulatePressure | boolean | stroke: taper the stroke as pen pressure would. Default false |
tolerance | number | make_work_path: tolerance in pixels (lower follows the selection more closely). Default 2 |
tool | string | stroke: the painting tool, with its current settings. Default brush |
edit_path_points Edit Path Points
Edit a path's anchor points, as the Add Anchor Point, Delete Anchor Point, Convert Point and Direct Selection tools do: add a point (splitting a segment in half without changing its shape, or at a position), delete one, move a point or its direction handles, convert it between smooth and corner, or change a component's path operation. The path is rebuilt under its name; a work path becomes a saved path
| Parameter | Type | Description |
|---|---|---|
operation * | string | The edit |
component | integer | Component (subpath) index from list_paths. Default 0 |
handleIn | object | Direction point of the arriving segment, pixels |
handleOut | object | Direction point of the leaving segment, pixels |
kind | string | convert_point: smooth computes handles from the neighbouring points unless handles are given; corner retracts the handles unless handles are given |
path | string | Path name, as in the Paths panel (list_paths) |
pathIndex | integer | Path index from list_paths, instead of its name |
pathOperation | string | set_operation: combine, subtract, intersect or exclude |
point | integer | Point index in the component. add_point: without x and y, splits the segment after this point; with them, inserts the new point at this index |
smooth | boolean | add_point with x and y: make a smooth point. Default false |
x | number | add_point and move_point: anchor position, pixels from the left |
y | number | add_point and move_point: anchor position, pixels from the top |
export_image Export Image
Export the document as one PNG, PNG-8, JPEG or GIF file (Save for Web), optionally resized. Works on a temporary copy, so the document is unchanged
| Parameter | Type | Description |
|---|---|---|
outputFile * | string | Absolute path; the extension must match the format |
blur | number | JPEG: blur before compressing, 0-2 pixels, to make the file smaller |
colorReduction | string | PNG-8 and GIF. Default selective |
colors | integer | PNG-8 and GIF colours. Default 256 |
dither | string | PNG-8 and GIF. Default diffusion |
format | string | png (PNG-24), png8, jpeg or gif. Default png |
height | number | Resize the export to this height in pixels (width follows) |
includeProfile | boolean | Embed the colour profile. Default false |
interlaced | boolean | Default false |
lossy | integer | GIF: lossy compression, 0-100 |
quality | integer | JPEG quality, 0-100. Default 80 |
transparency | boolean | Keep transparency (PNG, GIF). Default true |
webSnap | integer | PNG-8 and GIF: shift colours to web-safe ones within this tolerance, percent |
width | number | Resize the export to this width in pixels (height follows) |
export_layers Export Layers
Export each top-level layer or group (or the ones chosen) to its own file, named <prefix><layer name>.<ext>, by showing one at a time on a temporary copy (File > Export > Layers to Files)
| Parameter | Type | Description |
|---|---|---|
outputFolder * | string | Absolute folder path |
blur | number | JPEG: blur before compressing, 0-2 pixels, to make the file smaller |
colorReduction | string | PNG-8 and GIF. Default selective |
colors | integer | PNG-8 and GIF colours. Default 256 |
dither | string | PNG-8 and GIF. Default diffusion |
format | string | png (PNG-24), png8, jpeg or gif. Default png |
height | number | Resize the export to this height in pixels (width follows) |
ids | array | Top-level layer or group ids. Default all visible ones |
includeProfile | boolean | Embed the colour profile. Default false |
interlaced | boolean | Default false |
lossy | integer | GIF: lossy compression, 0-100 |
prefix | string | File name prefix |
quality | integer | JPEG quality, 0-100. Default 80 |
transparency | boolean | Keep transparency (PNG, GIF). Default true |
trim | boolean | Trim each export to the layer's pixels. Default false |
webSnap | integer | PNG-8 and GIF: shift colours to web-safe ones within this tolerance, percent |
width | number | Resize the export to this width in pixels (height follows) |
quick_export Quick Export
Quick Export the whole document, or chosen layers, groups or artboards, as PNG, JPG or GIF into a folder in one step (File > Export > Quick Export As; Layers panel > Quick Export As). Files are named after the document or each layer
| Parameter | Type | Description |
|---|---|---|
outputFolder * | string | Absolute folder path |
fileType | string | Default png |
includeMetadata | boolean | Include copyright and contact metadata. Default false |
layers | object | Export these layers, groups or artboards, each to its own file. Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true. Default: the whole document |
quality | integer | JPG quality, 1-100. Default 90 |
sRGB | boolean | Convert to sRGB. Default true |
export_layer_comps Export Layer Comps
Export layer comps, each to its own file (File > Export > Layer Comps to Files) or as the pages of one PDF (Layer Comps to PDF). The document is returned to its state before the export
| Parameter | Type | Description |
|---|---|---|
advanceSeconds | number | pdf: Slideshow: advance every this many seconds |
comps | array | Layer comp names. Default all |
fileType | string | files: psd, tiff, jpeg (default), png or pdf |
includeFilename | boolean | pdf: Print each file's name on its page |
loop | boolean | pdf: Slideshow: loop after the last page |
magnification | string | pdf: Slideshow: page view |
outputFile | string | pdf: absolute path ending in .pdf |
outputFolder | string | files: absolute folder path |
prefix | string | files: file name prefix; each file is <prefix><comp name> |
quality | integer | JPEG quality, 0-12. Default 10 |
slideshow | boolean | pdf: A full-screen slideshow instead of a multi-page document. Default false |
to | string | Default files |
transition | string | pdf: Slideshow: transition between pages |
export_paths_to_illustrator Export Paths To Illustrator
Export paths as an Adobe Illustrator file (File > Export > Paths to Illustrator): all paths, one named path, or just the document bounds
| Parameter | Type | Description |
|---|---|---|
outputFile * | string | Absolute path ending in .ai |
pathName | string | named: the path's name in the Paths panel |
paths | string | Default all |
make_pdf_presentation Make PDF Presentation
Combine image files into one multi-page PDF or a full-screen PDF slideshow (File > Automate > PDF Presentation), in the order given (a file may repeat), optionally adding the open documents, with slideshow timing, looping and transitions, file names on the pages, and Photoshop PDF save options
| Parameter | Type | Description |
|---|---|---|
outputFile * | string | Absolute path ending in .pdf |
advanceSeconds | number | Slideshow: advance every this many seconds |
files | array | Absolute paths of the source files, in page order |
includeFilename | boolean | Print each file's name on its page |
includeOpenFiles | boolean | Add the open documents that have been saved (Add Open Files), after files. Default false |
loop | boolean | Slideshow: loop after the last page |
magnification | string | Slideshow: page view |
pdfOptions | object | Photoshop PDF options, as for save_document's PDF options |
pdfPreset | string | Adobe PDF preset name, e.g. "[Smallest File Size]" |
pdfStandard | string | PDF/X standard |
slideshow | boolean | A full-screen slideshow instead of a multi-page document. Default false |
transition | string | Slideshow: transition between pages |
generate_image_assets Generate Image Assets
Set up Generator image assets (File > Generate > Image Assets): name layers with asset specs such as "icon.png", "200% hero@2x.png24" or "50x50 thumb.jpg80%" so Generator writes them to a folder next to the PSD, set the document-wide defaults layer ("default 200% @2x/"), and turn Image Assets on or off for the document
| Parameter | Type | Description |
|---|---|---|
assets | array | Layers to name as assets |
defaults | string | Document-wide defaults written as an empty layer named "default <defaults>", e.g. "200% @2x/, 50% small/" |
toggle | boolean | Switch Image Assets generation on or off for the document (it is a toggle). Default false |
list_history List History
List the History panel's states and snapshots, and which one is current
undo Undo
Step back (undo) or forward (redo) through the history, or go to a state by index. Undone steps stay available until something new is done
| Parameter | Type | Description |
|---|---|---|
steps | integer | Positive to undo, negative to redo. Default 1 |
toIndex | integer | Go to this history state instead |
make_snapshot Make Snapshot
Save the current state as a History snapshot, so it can be returned to later
| Parameter | Type | Description |
|---|---|---|
name | string |
edit_history Edit History
Change the history: revert to the last save (File > Revert), delete a state or snapshot, clear the history, make a new document from a state, set the history brush source or pick the History Brush tool (History panel), or purge every document's history (Edit > Purge > Histories). Clearing and purging cannot be undone
| Parameter | Type | Description |
|---|---|---|
operation * | string | |
index | integer | delete_state, set_brush_source: the state or snapshot (index from list_history). new_document: the state to copy. Default the current state |
set_history_options Set History Options
Read or set the history preferences: History Options (Automatically Create First Snapshot, Allow Non-Linear History, number of history states) and the History Log (Preferences > History & Content Credentials: on or off, saved to metadata, a text file or both, and how much it records)
| Parameter | Type | Description |
|---|---|---|
autoFirstSnapshot | boolean | Automatically Create First Snapshot |
log | boolean | Turn the History Log on or off |
logDetail | string | Edit Log Items: sessions only, concise or detailed |
logFile | string | Absolute path of the log text file, for logTo file or both |
logTo | string | Where the log is saved |
nonLinear | boolean | Allow Non-Linear History |
states | integer | History states kept per document |
get_timeline Get Timeline
Describe the document's timeline (Timeline panel): frame rate, playhead time, duration and work area when Photoshop reports them, the frame count in frame animation mode, and the video layers
create_timeline Create Timeline
Create a video timeline or a frame animation for the document, or convert between the two (Timeline panel: Create Video Timeline, Create Frame Animation, Convert to Frame Animation, Convert to Video Timeline)
| Parameter | Type | Description |
|---|---|---|
mode * | string | video (new video timeline), frames (new frame animation), convert_to_frames or convert_to_video |
frameRate | number | Frame rate for a new or converted video timeline, in frames per second |
set_timeline Set Timeline
Set the timeline: show or hide the Timeline panel, set the frame rate (Set Timeline Frame Rate), move the playhead to a time or Go To a frame or the work area, and choose the Layers panel's Animation Options
| Parameter | Type | Description |
|---|---|---|
animationOptions | string | Layers panel Animation Options: automatic, always_show or always_hide the unified layer buttons |
frameRate | number | Timeline frame rate in frames per second |
goTo | string | Move the playhead instead: first or last frame, one frame or one second forward or back, or the work area start or end |
panel | string | Show or hide the Timeline panel (Window > Timeline) |
time | object | Move the playhead (current-time indicator) to this time |
run_timeline_command Run Timeline Command
Run a video timeline command on the selected clips, keyframes or video layer at the playhead (Timeline panel menu: Move & Trim, Split at Playhead, Work Area, Keyframes, Convert Frames, Enable Onion Skins, Show; Layer > Video Layers: Insert, Delete, Duplicate, Reload or Restore Frame, Hide Altered Video). Toggles switch the setting each time
| Parameter | Type | Description |
|---|---|---|
command * | string | The command to run |
target | object | Clips (layers) to select first. Default: the current selection |
edit_frame_animation Edit Frame Animation
Edit a frame animation (Timeline panel in frame mode): new, delete, copy, paste, reverse or tween frames, select a frame, make frames from layers, flatten frames into layers, match a layer across frames, delete the animation, and the New Layers options. Tween and Paste Frames use the dialog's last settings
| Parameter | Type | Description |
|---|---|---|
command * | string | The command to run on the selected frames |
frame | integer | For select_frame: the frame number, 1 for the first |
matchPosition | boolean | For match_layer: match the active layer's position. Default true |
matchStyle | boolean | For match_layer: match its layer style. Default true |
matchVisibility | boolean | For match_layer: match its visibility. Default true |
add_video_layer Add Video Layer
Add a blank video layer above the active layer, for frame-by-frame painting (Layer > Video Layers > New Blank Video Layer)
| Parameter | Type | Description |
|---|---|---|
name | string | Name for the new layer |
import_video_frames Import Video Frames
Import a video file's frames as layers of a new document, optionally as a frame animation (File > Import > Video Frames to Layers)
| Parameter | Type | Description |
|---|---|---|
file * | string | Absolute path of the video file |
endTime | object | Import up to this time. Default the end |
frameRate | number | The video's frame rate, which the frames in startTime and endTime count in. Default 30 |
frameSkip | integer | Keep every Nth frame (Limit To Every N Frames) |
makeAnimation | boolean | Make a frame animation from the layers. Default false |
startTime | object | Import from this time. Default the start |
set_clip_timing Set Clip Timing
Move the in or out point of clips (layer duration bars) in the video timeline, or set their duration
| Parameter | Type | Description |
|---|---|---|
target * | object | Which layers to act on. Give ids (from list_layers or a create tool), names, or active: true |
duration | object | Set each clip's duration instead, measured from its in point |
moveIn | object | Move each clip's in point by this offset (negative is earlier) |
moveOut | object | Move each clip's out point by this offset (negative is earlier) |
add_video_transition Add Video Transition
Add a transition (Fade, Cross Fade, Fade With Black or Fade With White) where two adjacent clips meet in the video timeline (Timeline panel transitions)
| Parameter | Type | Description |
|---|---|---|
target * | object | The two adjacent clips (layers) to join |
duration | object | Transition length. Default 1 second |
type | string | fade, cross_fade, fade_black or fade_white. Default cross_fade |
render_video Render Video
Render the timeline to a video file through Adobe Media Encoder (File > Export > Render Video), at the document size
| Parameter | Type | Description |
|---|---|---|
name * | string | File name, ending in .mp4 for h264 or .mov for quicktime |
outputFolder * | string | Absolute folder to render into |
format | string | h264 (MP4) or quicktime (MOV). Default h264 |
frameRate | number | Output frame rate. Default the timeline's |
preset | string | Media Encoder preset file name, as listed in the Render Video dialog. Default "1_High Quality.epr" for h264; required for quicktime |
list_action_sets List Action Sets
List the Actions panel's action sets and the actions in each, optionally with each action's recorded steps (Window > Actions)
| Parameter | Type | Description |
|---|---|---|
steps | boolean | Include each action's step names. Default false |
edit_actions Edit Actions
Change the Actions panel: create an empty set, delete a set, an action or one of its steps, clear every set, reset to Default Actions, load an .atn file or one of Photoshop's bundled sets, or save a set as an .atn file (Actions panel menu)
| Parameter | Type | Description |
|---|---|---|
operation * | string | create_set (New Set), delete (Delete), clear_all (Clear All Actions), reset (Reset Actions: clear, then load Default Actions), load (Load Actions), save (Save Actions) |
action | string | delete: the action to delete (or whose step to delete) inside set |
filePath | string | load or save: absolute path of an .atn file |
preset | string | load: a set bundled in Photoshop's Presets/Actions folder, e.g. "Frames", "Image Effects", "Production" |
set | string | Set name: the new set for create_set, the set to delete, save, or that holds action |
step | integer | delete: the step number (1 = first) inside action |
set_action_options Set Action Options
Set how actions play back (Actions panel menu > Playback Options: accelerated, step by step, or pause between steps), and toggle Button Mode or Allow Tool Recording
| Parameter | Type | Description |
|---|---|---|
pauseSeconds | integer | Seconds between steps, for playback pause. Default 1 |
playback | string | Playback Options performance |
toggleButtonMode | boolean | Switch Button Mode on or off (it toggles; the panel shows the current state) |
toggleToolRecording | boolean | Switch Allow Tool Recording on or off (it toggles) |
run_action_batch Run Action Batch
Play an action on every file in a folder, a list of files, or the open documents, and leave, save over, or save them to a folder (File > Automate > Batch). Long batches can outlast the script timeout (PHOTOSHOP_SCRIPT_TIMEOUT_MS)
| Parameter | Type | Description |
|---|---|---|
action * | string | Action name, as in the Actions panel (list_action_sets) |
set * | string | Action set name |
compatibility | object | File name compatibility. Default: the current platform only |
destination | string | none: leave files open, save_and_close: save over the source, folder: save into destinationFolder. Default none |
destinationFolder | string | Absolute folder path, for destination folder |
errorLog | string | Absolute path of a text file to log errors to (Log Errors To File). Omit to stop for errors |
extensions | array | Only files with these extensions from sourceFolder, e.g. ["jpg", "png"] |
fileNaming | array | File Naming for destination folder: up to 6 parts joined in order. Default ["document_name", "extension_lower"] |
files | array | Source: these absolute file paths |
includeSubfolders | boolean | Include All Subfolders of sourceFolder. Default false |
openDocuments | boolean | Source: the open documents (Opened Files); each must have been saved |
overrideOpen | boolean | Override Action "Open" Commands: the action's own Open steps open each source file instead. Default false |
overrideSaveAs | boolean | Override Action "Save As" Commands: the action's Save As steps save into the destination instead of their recorded place. Default false |
sourceFolder | string | Source: every file in this absolute folder path |
startingSerial | integer | Starting serial number for serial parts. Default 1 |
suppressOpenDialogs | boolean | Suppress File Open Options Dialogs (camera raw and similar). Default true |
suppressProfileWarnings | boolean | Suppress Color Profile Warnings. Default true |
create_droplet Create Droplet
Save an action as a droplet: an application that plays the action on files dropped onto it, with Batch's open, save and naming options (File > Automate > Create Droplet)
| Parameter | Type | Description |
|---|---|---|
action * | string | Action name, as in the Actions panel (list_action_sets) |
filePath * | string | Absolute path of the droplet to create (an .app on macOS, an .exe on Windows) |
set * | string | Action set name |
compatibility | object | File name compatibility. Default: the current platform only |
destination | string | none: leave files open, save_and_close: save over the source, folder: save into destinationFolder. Default none |
destinationFolder | string | Absolute folder path, for destination folder |
errorLog | string | Absolute path of a text file to log errors to (Log Errors To File). Omit to stop for errors |
fileNaming | array | File Naming for destination folder: up to 6 parts joined in order. Default ["document_name", "extension_lower"] |
overrideOpen | boolean | Override Action "Open" Commands: the action's own Open steps open each source file instead. Default false |
overrideSaveAs | boolean | Override Action "Save As" Commands: the action's Save As steps save into the destination instead of their recorded place. Default false |
startingSerial | integer | Starting serial number for serial parts. Default 1 |
suppressOpenDialogs | boolean | Suppress File Open Options Dialogs (camera raw and similar). Default true |
suppressProfileWarnings | boolean | Suppress Color Profile Warnings. Default true |
run_automate_command Run Automate Command
Run a File > Automate or File > Scripts command on the active document without its dialog: crop_and_straighten (Crop and Straighten Photos: each scanned photo into its own document), fit_image (Fit Image: resize to fit a box), conditional_mode_change (Conditional Mode Change), lens_correction (Automate > Lens Correction's automatic profile correction), delete_empty_layers (Delete All Empty Layers), flatten_layer_effects (Flatten All Layer Effects), flatten_masks (Flatten All Masks)
| Parameter | Type | Description |
|---|---|---|
command * | string | |
autoScale | boolean | lens_correction: scale to hide blank edges. Default true |
chromaticAberration | boolean | lens_correction: correct chromatic aberration. Default false |
distortion | boolean | lens_correction: correct geometric distortion. Default true |
dontEnlarge | boolean | fit_image: leave images already smaller than the box. Default false |
edge | string | lens_correction: fill for edges left blank. Default transparency |
flatten | boolean | conditional_mode_change: flatten while converting. Default false |
height | number | fit_image: box height in pixels |
sourceModes | array | conditional_mode_change: convert only from these modes. Default all |
targetMode | string | conditional_mode_change: the mode to convert to |
vignette | boolean | lens_correction: remove vignetting. Default false |
width | number | fit_image: box width in pixels |
combine_images Combine Images
Combine image files into a new document with one of Photoshop's multi-file commands, without its dialog: stack (File > Scripts > Load Files into Stack), photomerge (File > Automate > Photomerge panorama), hdr (File > Automate > Merge to HDR Pro, with its last-used settings) or statistics (File > Scripts > Statistics stack mode). Large merges can outlast the script timeout
| Parameter | Type | Description |
|---|---|---|
files * | array | Absolute paths of two or more images |
method * | string | |
align | boolean | stack, hdr, statistics: auto-align the layers. Default false (hdr: true) |
blend | boolean | photomerge: Blend Images Together. Default true |
distortionCorrection | boolean | photomerge: Geometric Distortion Correction. Default false |
fillTransparent | boolean | photomerge: Content Aware Fill Transparent Areas. Default false |
layout | string | photomerge: Auto (default), Perspective, Cylindrical, Spherical, Collage or Reposition |
smartObject | boolean | stack: convert the stack into a smart object. Default false |
statistic | string | statistics: the stack mode. Default median |
vignetteRemoval | boolean | photomerge: Vignette Removal. Default false |
manage_script_events Manage Script Events
List, add or remove the scripts and actions Photoshop runs when an event happens, and turn them on or off (File > Scripts > Script Events Manager)
| Parameter | Type | Description |
|---|---|---|
operation * | string | |
event | string | add: the event, as a four-character code or event id, e.g. "Opn " (Open Document), "save", "Mk " (New Document) |
eventClass | string | add: the class the event applies to, e.g. "Dcmn" to fire Make only for documents |
index | integer | remove: the notifier's index from list |
scriptFile | string | add: absolute path of the .jsx or .js script to run |
manage_data_sets Manage Data Sets
Work with variable data sets on the active document: import them from a text file (File > Import > Variable Data Sets), apply one (Image > Apply Data Set), or save a PSD per data set into a folder (File > Export > Data Sets as Files). Variables themselves are defined in Image > Variables > Define
| Parameter | Type | Description |
|---|---|---|
operation * | string | |
filePath | string | import: absolute path of the comma- or tab-delimited text file |
firstColumnNames | boolean | import: use the first column as the data set names. Default false |
folder | string | export: absolute folder path |
name | string | apply: the data set name |
names | array | export: the data sets to save, each as <name>.psd |
replace | boolean | import: replace the existing data sets. Default true |
get_artboards Get Artboards
List the active document's artboards with id, name, position and size in pixels, layer count and background (Artboard properties in the Properties panel)
create_artboard Create Artboard
Create an artboard: new at a position and size (Layer > New > Artboard), from layers (Artboard from Layers), from a group (Artboard from Group), or a new document of type Artboard (File > New). The steps in the document form one history state
| Parameter | Type | Description |
|---|---|---|
background | string | Artboard background: "white", "black", "transparent", or a colour ("#RRGGBB", "rgb(r,g,b)", ...) |
from | string | Default new |
height | number | new, document: height in pixels |
name | string | Artboard (or document) name |
resolution | number | document: pixels per inch. Default 72 |
target | object | layers: the layers to put on the artboard. group: the group to convert |
width | number | new, document: width in pixels |
x | number | new: left edge in pixels. Default to the right of the existing artboards |
y | number | new: top edge in pixels. Default 0 |
edit_artboards Edit Artboards
Change artboards: set name, position, size, background colour and auto-nesting (Properties panel), duplicate one, ungroup them back to layers (Layer > Ungroup Artboards), clear their guides (View > Guides > Clear Selected Artboard Guides), add guides from a shape (New Artboard Guides From Shape), or pick the Artboard or Frame tool
| Parameter | Type | Description |
|---|---|---|
operation * | string | |
autoNest | boolean | set: let layers moved onto or off the artboard nest into or out of it automatically (false prevents auto-nesting) |
background | string | Artboard background: "white", "black", "transparent", or a colour ("#RRGGBB", "rgb(r,g,b)", ...) |
height | number | set: height in pixels |
name | string | set, duplicate: new name |
target | object | The artboards (ids from get_artboards); for guides_from_shape, the shape layer |
tool | string | select_tool: the Artboard tool or the Frame tool |
width | number | set: width in pixels |
x | number | set, duplicate: left edge in pixels |
y | number | set, duplicate: top edge in pixels |
create_frame Create Frame
Put layers inside a frame (Add Frame to Layers) or turn a group into a frame (Add Frame To Layer Group); the frame clips its contents to its shape
| Parameter | Type | Description |
|---|---|---|
target * | object | layers: the layers to frame. group: the group to convert |
from | string | Default layers |
export_artboards Export Artboards
Save each artboard as its own file, cropped to the artboard with its background, as PNG, JPEG, PSD, TIFF or PDF (File > Export > Artboards to Files), or all of them as one multi-page PDF (Artboards to PDF). The document is not changed
| Parameter | Type | Description |
|---|---|---|
folder * | string | Absolute folder path |
format | string | Default png |
includeBackground | boolean | Fill with the artboard background colour (unless it is transparent). Default true |
pdfName | string | singlePdf: the PDF file name. Default the document name |
prefix | string | Text before each artboard name in the file names |
singlePdf | boolean | pdf: one multi-page PDF instead of one PDF per artboard. Default false |
target | object | Only these artboards. Default all |
manage_recent_files Manage Recent Files
List the files in File > Open Recent, open one of them by its index, or clear the list (Clear Recent File List)
| Parameter | Type | Description |
|---|---|---|
action | string | Default list |
index | integer | open: the file's index in the list |
close_documents Close Documents
Close every open document (File > Close All). Unsaved changes are discarded unless save is true; with save, documents that have never been saved are refused before anything closes
| Parameter | Type | Description |
|---|---|---|
save | boolean | Save each document before closing it. Default false |
go_to_bridge Go To Bridge
Open Adobe Bridge (File > Browse in Bridge), or close the active document and switch to Bridge (File > Close and Go to Bridge). Needs Bridge installed
| Parameter | Type | Description |
|---|---|---|
closeDocument | boolean | Close the active document first. It must have no unsaved changes. Default false |
get_document_metadata Get Document Metadata
Read the active document's File Info metadata: title, author, description, keywords, copyright, IPTC origin, categories, the camera data (Exif), and optionally the raw XMP packet
| Parameter | Type | Description |
|---|---|---|
includeXmp | boolean | Include the raw XMP packet. Default false |
set_document_metadata Set Document Metadata
Set the active document's File Info metadata: title, author, description, keywords, copyright, IPTC origin and categories, or replace its whole XMP packet. Only the fields given change. Camera data (Exif) is read-only
| Parameter | Type | Description |
|---|---|---|
author | string | Creator (author) name |
authorPosition | string | Creator's job title |
caption | string | Caption (description) |
captionWriter | string | Description writer |
category | string | Legacy IPTC category (up to 3 characters) |
city | string | City |
copyrightNotice | string | Copyright notice |
copyrighted | string | Copyright status |
country | string | Country |
creationDate | string | Date created, YYYYMMDD |
credit | string | Credit line |
headline | string | Headline |
instructions | string | Special instructions |
jobName | string | Job name |
keywords | array | Keywords (replaces the list) |
ownerUrl | string | Copyright info URL |
provinceState | string | State or province |
source | string | Source |
supplementalCategories | array | Supplemental categories (replaces the list) |
title | string | Document title |
transmissionReference | string | Job identifier (transmission reference) |
urgency | string | Urgency: 1 (high) to 8 (low), 5 normal, or none |
xmp | string | A complete XMP packet (<x:xmpmeta ...>) that replaces the document's metadata. Applied before the fields above |
manage_document_notes Manage Document Notes
Work with notes (non-printing annotations): import the notes from a PDF or FDF file into the active document (File > Import > Notes), delete all of its notes (Note tool: Clear All), choose the Note tool, or show or hide the Notes panel (Window > Notes). Writing a note's text is done by hand with the Note tool
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do |
file | string | import: absolute path of a PDF or FDF file with notes |
set_file_handling_preferences Set File Handling Preferences
Set and read file-handling preferences: image previews saved with files (macOS icon and full-size previews, Mac and Windows thumbnails), the length of File > Open Recent, and the History Log (on or off, saved to the file's metadata or a text file, and its detail). Call with no settings to read them
| Parameter | Type | Description |
|---|---|---|
fullSizePreview | boolean | macOS: save a full-size preview |
historyLog | boolean | Keep the edit history log |
historyLogDetail | string | Edit log items |
historyLogFile | string | Absolute path of the text file the History Log is written to |
historyLogSaveTo | string | Where the history log goes: the file's metadata (readable in File Info), a text file, or both |
iconPreview | boolean | macOS: save an icon preview |
imagePreviews | string | Save image previews: always, never or ask when saving |
macThumbnail | boolean | macOS: save a Macintosh thumbnail |
recentFileListLength | integer | Files listed in File > Open Recent |
windowsThumbnail | boolean | Save a Windows thumbnail |
place_file Place File
Place an image, PDF, vector or other file in the active document as a smart object (File > Place Embedded), or as a smart object linked to the file (File > Place Linked), positioned, scaled and rotated
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Absolute path of the file to place |
angle | number | Rotation in degrees |
center | object | Where the placed item's centre goes, in pixels from the top-left. Default the document centre |
linked | boolean | Link to the file instead of embedding it. Default false |
scale | number | Scale in percent, both directions |
scaleX | number | Horizontal scale in percent |
scaleY | number | Vertical scale in percent |
get_print_options Get Print Options
Read the active document's print settings (File > Print): the printer and the printers available, copies, colour handling, print space, rendering intent, position and scale, printing marks, functions and PostScript options
set_print_options Set Print Options
Change the active document's print settings (File > Print) without the dialog: printer, copies, colour handling (including separations), print space, rendering intent, black point compensation, hard proof, position and scale, printing marks, functions (emulsion down, negative, background, border, bleed) and PostScript options. Only the settings given change
| Parameter | Type | Description |
|---|---|---|
background | string | Functions: page background colour. "#RRGGBB", "rgb(r,g,b)" (0-255), "cmyk(c,m,y,k)" (0-100), "gray(g)" (0-100, 100 = black), "hsb(h,s,b)" (0-360, 0-100, 0-100) or "lab(L,a,b)" |
blackPointCompensation | boolean | Black point compensation |
bleed | number | Functions: bleed width, pixels |
border | number | Functions: border width, pixels |
centerCropMarks | boolean | Printing marks: centre crop marks |
colorBars | boolean | PostScript: colour calibration bars |
colorHandling | string | Photoshop manages colours, the printer manages colours, or print each channel as a separation |
copies | integer | Number of copies |
cornerCropMarks | boolean | Printing marks: corner crop marks |
description | boolean | Printing marks: print the File Info description |
flip | boolean | Functions: emulsion down (flip horizontally) |
hardProof | boolean | Print a hard proof that simulates the Proof Setup device |
interpolate | boolean | PostScript: interpolation |
labels | boolean | Printing marks: print the document title |
negative | boolean | Functions: negative |
position | object | Position and scale on the page: centered, fit (scale to fit the media), or custom with x and y (pixels from the page's top-left) and scale (percent) |
printSpace | string | Printer profile (print space) name; empty string for the same as the source |
printer | string | Printer name, from get_print_options |
registrationMarks | boolean | Printing marks: registration marks |
renderingIntent | string | Rendering intent when the print space differs from the source |
vectorData | boolean | PostScript: include vector data |
print_image Print Image
Print the active document with its print settings and no Print dialog (File > Print), or print one copy with the current settings (File > Print One Copy). Set the printer and options first with set_print_options
| Parameter | Type | Description |
|---|---|---|
blackPointCompensation | boolean | Default true |
oneCopy | boolean | Print One Copy with the current settings; the other options do not apply. Default false |
printSpace | string | Printer profile name. Default: the print settings' print space |
renderingIntent | string | Default relative_colorimetric |
source | string | Print the document's colours, or a hard proof of the Proof Setup. Default document |
apply_trap Apply Trap
Add trapping to a CMYK document (Image > Trap): overlaps between adjacent colours that hide misregistration on press. The document must be in CMYK mode
| Parameter | Type | Description |
|---|---|---|
width * | number | Trap width in pixels |
get_photoshop_info Get Photoshop Info
Describe the running Photoshop (About Photoshop, System Info): version, build, locale, free memory, the preferences folder, the file types it opens, the script dialog mode, and optionally the full System Info report or whether named features are enabled
| Parameter | Type | Description |
|---|---|---|
features | array | Feature names to check with Application.featureEnabled, e.g. "photoshop/extended" |
systemInfo | boolean | Include the Help > System Info report (long). Default false |
get_photoshop_preferences Get Photoshop Preferences
Read Photoshop's preferences (Photoshop > Settings, or Edit > Preferences on Windows) that scripts can reach: general, interface, file handling, performance, cursors, transparency, units and rulers, guides and grid, plug-ins, type, and the script dialog mode
set_photoshop_preferences Set Photoshop Preferences
Change Photoshop's preferences (Photoshop > Settings, or Edit > Preferences on Windows). Give only the settings to change; the result lists every preference afterwards. Some take effect after a restart
| Parameter | Type | Description |
|---|---|---|
additionalPluginFolder | string | Absolute path of the Additional Plug-ins Folder; also turns it on (Preferences > Plugins) |
appendExtension | string | Append File Extension: always, never or ask (Preferences > File handling) |
askBeforeSavingLayeredTIFF | boolean | Ask before saving layered TIFF files (Preferences > File handling) |
autoUpdateOpenDocuments | boolean | Auto-update open documents changed on disk (Preferences > General) |
beepWhenDone | boolean | Beep When Done (Preferences > General) |
cacheForHistograms | boolean | Use the image cache for histograms (Preferences > Performance) |
cacheLevels | integer | Cache Levels, 1-8 (Preferences > Performance) |
colorPicker | string | Color Picker (Preferences > General) |
colorTheme | string | Interface colour theme, darkest to lightest (Preferences > Interface) |
columnGutter | number | Column Size gutter, in points (Preferences > Units rulers) |
columnWidth | number | Column Size width, in points (Preferences > Units rulers) |
dynamicColorSliders | boolean | Dynamic Color Sliders (Preferences > General) |
exportClipboard | boolean | Export Clipboard to other applications (Preferences > General) |
fontNamesInEnglish | boolean | Show Font Names in English (Preferences > Type) |
fontPreviewSize | string | Font Preview Size in font menus (none turns previews off) (Preferences > Type) |
gamutWarningOpacity | number | Gamut Warning opacity, percent (Preferences > Transparency gamut) |
gridStyle | string | Grid line style (Preferences > Guides grid slices) |
gridSubdivisions | integer | Grid Subdivisions (Preferences > Guides grid slices) |
guideStyle | string | Guide line style (Preferences > Guides grid slices) |
historyStates | integer | History States kept per document (Preferences > Performance) |
imagePreviews | string | Image Previews: always save, never save or ask when saving (Preferences > File handling) |
interpolation | string | Image Interpolation used when resampling (Preferences > General) |
lowerCaseExtension | boolean | Use lower case file extensions (Preferences > File handling) |
maxRAMuse | number | Memory Usage: percentage of available RAM Photoshop may use (Preferences > Performance) |
maximizeCompatibility | string | Maximize PSD and PSB File Compatibility: always, never or ask (Preferences > File handling) |
otherCursors | string | Other Cursors (Preferences > Cursors) |
paintingCursors | string | Painting Cursors (Preferences > Cursors) |
pixelDoubling | boolean | Pixel doubling (legacy) (Preferences > Legacy) |
pointSize | string | Point/Pica Size: PostScript (72 points/inch) or traditional (72.27 points/inch) (Preferences > Units rulers) |
recentFileListLength | integer | Recent File List Contains, 0-100 files (Preferences > File handling) |
rulerUnits | string | Rulers units (this server still measures in pixels) (Preferences > Units rulers) |
savePaletteLocations | boolean | Remember panel locations (Preferences > General) |
scriptDialogs | string | Application.displayDialogs: whether other scripts and actions show dialogs (all, errors only or none). This server always runs its own scripts with dialogs off (Preferences > Scripting) |
showAsianTextOptions | boolean | Show Asian text options (Preferences > Type) |
showChannelsInColor | boolean | Show Channels in Color (Preferences > Interface) |
showSliceNumbers | boolean | Show Slice Numbers (Preferences > Guides grid slices) |
showToolTips | boolean | Show Tool Tips (Preferences > Interface) |
smartQuotes | boolean | Use Smart Quotes (Preferences > Type) |
transparencyGridSize | string | Transparency checkerboard Grid Size (Preferences > Transparency gamut) |
typeUnits | string | Type units (this server still measures in pixels) (Preferences > Units rulers) |
uiFontSize | string | UI Font Size (takes effect after a restart) (Preferences > Interface) |
useAdditionalPluginFolder | boolean | Use the Additional Plug-ins Folder (takes effect after a restart) (Preferences > Plugins) |
useDiffusionDither | boolean | Diffusion dither (legacy) (Preferences > Legacy) |
useShiftKeyForToolSwitch | boolean | Use Shift Key for Tool Switch (whether a tool shortcut needs Shift to cycle through grouped tools) (Preferences > General) |
useVideoAlpha | boolean | Video alpha (legacy) (Preferences > Legacy) |
zoomResizesWindows | boolean | Zoom Resizes Windows (Preferences > General) |
purge_photoshop_caches Purge Photoshop Caches
Free memory with Edit > Purge: the undo buffer, the clipboard, the histories of open documents, or all of them. It cannot be undone
| Parameter | Type | Description |
|---|---|---|
target | string | What to purge. Default all |
run_photoshop_command Run Photoshop Command
Run an application command: beep, bring Photoshop to the front, redraw the screen, hide Photoshop or the other applications or show them all again (Photoshop menu, macOS only), open Help > Photoshop Help, or open the Creative Cloud account page in the browser
| Parameter | Type | Description |
|---|---|---|
command * | string | The command |
manage_script_options Manage Script Options
Store, read or erase named values that persist in Photoshop between sessions (Application.putCustomOptions, getCustomOptions and eraseCustomOptions), for keeping settings across calls
| Parameter | Type | Description |
|---|---|---|
action * | string | get the values, set (replace) them, or erase them |
key * | string | A unique key, e.g. "com.example.myScript" |
persistent | boolean | set: keep after Photoshop quits. Default true |
values | object | set: { name: string, number or boolean }. Names are letters, digits and underscores |
quit_photoshop Quit Photoshop
Quit Photoshop (File > Exit, or Photoshop > Quit Photoshop on macOS). Refuses while documents have unsaved changes unless discardUnsaved is true, which closes them without saving first
| Parameter | Type | Description |
|---|---|---|
discardUnsaved | boolean | Close documents with unsaved changes without saving them. Default false |
arrange_photoshop_windows Arrange Photoshop Windows
Arrange document windows (Window > Arrange): tile, 2-up to 6-up, consolidate to tabs, cascade, float, open a new window for the active document, or match zoom, location or rotation across windows
| Parameter | Type | Description |
|---|---|---|
layout * | string | The Window > Arrange command |
set_zoom_and_screen_mode Set Zoom And Screen Mode
Zoom the active document (View > Zoom In, Zoom Out, Fit on Screen, 100%, 200%, Print Size) and choose the screen mode (View > Screen Mode: standard, full screen with menu bar, full screen)
| Parameter | Type | Description |
|---|---|---|
screenMode | string | The screen mode |
zoom | string | The View menu zoom command |
toggle_view_extras Toggle View Extras
Toggle View menu items for the active document: Extras, each View > Show item (layer and selection edges, target path, grid, guides, count, smart guides, slices, notes, pixel grid, brush preview), Rulers, Lock Guides, Lock Slices, Snap and each Snap To item. show_all, show_none, snap_to_all and snap_to_none set rather than toggle. Photoshop does not tell scripts whether an item is on
| Parameter | Type | Description |
|---|---|---|
items * | array | Items to toggle, in order |
show_photoshop_panels Show Photoshop Panels
Show or hide panels (Window menu), hide or show all panels at once (Tab), reset to the Essentials workspace, and use the Histogram panel menu (compact, expanded or all-channels view, statistics, channels in colour, uncached refresh) and the Info panel's Color Samplers item
| Parameter | Type | Description |
|---|---|---|
hide | array | Panels to hide |
histogramView | string | Histogram panel view |
refreshHistogram | boolean | Histogram panel Uncached Refresh |
show | array | Panels to show |
toggleAllPanels | boolean | Hide all panels, or show them again (Application.togglePalettes) |
toggleHistogram | array | Histogram panel options to toggle |
toggleInfoColorSamplers | boolean | Toggle the Info panel menu's Color Samplers item |
workspace | string | Switch to Window > Workspace > Essentials (Default) |
select_view_tool Select View Tool
Make a view tool current in the Tools panel: Hand, Zoom, Rotate View (needs the graphics processor), Slice or Slice Select. Using the tool on the canvas stays with the user
| Parameter | Type | Description |
|---|---|---|
tool * | string | The tool |
edit_photoshop_guides Edit Photoshop Guides
Work with guides in the active document (View > Guides): add guides at pixel positions, lay out columns, rows and margins (New Guide Layout), make guides from the selected shape layer (New Guides From Shape), clear all guides or only canvas guides, or clear slices (View > Clear Slices). Returns the guides afterwards
| Parameter | Type | Description |
|---|---|---|
action * | string | What to do |
clearExisting | boolean | layout: remove existing guides first. Default true |
columns | integer | layout: number of columns |
direction | string | add: guide direction |
gutter | number | layout: space between columns and between rows, in pixels. Default 0 |
margin | object | layout: margins in pixels; a guide is placed at each margin given |
positions | array | add: pixel positions from the top (horizontal) or left (vertical) edge |
rows | integer | layout: number of rows |
target | object | from_shape: the shape layer. Default the active layer |
open_raw_file Open Raw File
Open a camera raw file through Camera Raw without its dialog, with the camera's defaults, the settings last used, or custom Basic, Detail, Lens and Calibration values and Workflow Options (colour space, bit depth, size, resolution). These are the object model's older Camera Raw controls
| Parameter | Type | Description |
|---|---|---|
filePath * | string | Absolute path to the raw file |
bitsPerChannel | integer | Workflow Options: bit depth |
brightness | number | Brightness, 0-150 (process versions 2003 and 2010) |
calibration | object | Calibration: hue and saturation of each primary and the shadow tint, each -100 to 100 |
chromaticAberrationBY | number | Chromatic aberration blue/yellow, -100 to 100 |
chromaticAberrationRC | number | Chromatic aberration red/cyan, -100 to 100 |
colorNoiseReduction | number | Color noise reduction, 0-100 |
colorSpace | string | Workflow Options: colour space |
contrast | number | Contrast, -50 to 100 |
exposure | number | Exposure in stops, -4 to 4 |
luminanceSmoothing | number | Luminance noise reduction, 0-100 |
resolution | number | Workflow Options: resolution, pixels per inch |
saturation | number | Saturation, -100 to 100 |
settings | string | camera (Camera Raw defaults), selected_image (the settings last used) or custom (the values given). Default custom when values are given, otherwise camera |
shadows | number | Shadows, 0-100 |
sharpness | number | Sharpening amount, 0-100 |
size | string | Workflow Options: image size |
temperature | number | White balance temperature in kelvin, 2000-50000 |
tint | number | White balance tint, -150 to 150 |
vignettingAmount | number | Lens vignetting amount, -100 to 100 |
vignettingMidpoint | number | Lens vignetting midpoint, -100 to 100 |
whiteBalance | string | White balance preset |
apply_camera_raw_settings Apply Camera Raw Settings
Apply Filter > Camera Raw Filter to layers without its dialog, with the settings of its panels: Basic (white balance, exposure, contrast, highlights, shadows, whites, blacks, texture, clarity, dehaze, vibrance, saturation), Curve (parametric regions and splits, point curves, refine saturation), Detail (sharpening, noise reduction), Color Mixer (HSL), Color Grading (wheels, blending, balance), Optics (lens vignetting, defringe), Effects (vignette, grain) and Masking (local corrections through linear gradient, radial gradient and luminance range masks; these replace any local corrections the fil…
apply_neural_filter Apply Neural Filter
Run a Neural Filter (Filter > Neural Filters) on the active layer without its workspace: Depth Blur, Style Transfer or Photo Restoration. The filter must already be downloaded in the Neural Filters panel; some filters process in the cloud and need a signed-in Adobe account
| Parameter | Type | Description |
|---|---|---|
filter * | string | The filter |
options | object | Sliders, 0-100. depth_blur: aperture, focalDistance, focalRange, haze. style_transfer: brushSize, preserveWeight, blur. photo_restoration: enhance (Photo Enhancement), faceEnhance (Enhance Face), scra… |
preserveColor | boolean | style_transfer: keep the image's colours. Default false |
style | string | style_transfer: preset style id. Default "style28_crop" |
replace_sky Replace Sky
Replace the sky in the active document (Edit > Sky Replacement) with an image file, without the dialog. Photoshop finds the sky, adds a Sky Replacement group with the new sky and lighting and colour layers, and returns it. Edge, brightness, temperature, lighting and colour settings match the dialog's
| Parameter | Type | Description |
|---|---|---|
skyFile * | string | Absolute path to the sky image (a Sky_Presets image or any JPEG or PNG) |
brightness | number | Sky brightness, -100 to 100. Default 0 |
colorAdjustment | number | Color Adjustment, 0-100. Default 50 |
edgeLighting | number | Edge Lighting, 0-100. Default 50 |
fadeEdge | number | Fade Edge, 0-100. Default 25 |
foregroundLighting | number | Foreground Lighting adjustment, 0-100. Default 50 |
lightingMode | string | Lighting mode for the foreground lighting layer. Default screen; Photoshop may choose its own blend from the sky |
output | string | Output to new layers (default) or a duplicate layer |
shiftEdge | number | Shift Edge, -100 to 100. Default 0 |
temperature | number | Sky temperature, -100 to 100. Default 0 |
remove_background Remove Background
Remove the background of layers (the Properties panel's Remove Background quick action): Photoshop finds the subject and adds a layer mask hiding the rest. It uses the Select Subject model, which may process in the cloud depending on Preferences > Image Processing
| Parameter | Type | Description |
|---|---|---|
target | object | Layers. Default the active layer |
generative_fill Generative Fill
Generative Fill (Edit > Generative Fill) inside the current selection: generate content from a prompt, or with an empty prompt remove what is selected and fill from the surroundings. Results go to a new Generative Layer. Needs a selection, Photoshop signed in to an Adobe account and an internet connection; uses generative credits
| Parameter | Type | Description |
|---|---|---|
contentType | string | Content type: none (automatic, default), photo or art |
prompt | string | What to generate in the selection; empty or omitted to remove the selected content |
seed | integer | Seed for repeatable results; -1 (default) picks one at random |
generate_image Generate Image
Generate Image (Edit > Generate Image): create an image from a text prompt as a new layer filling the active document. Needs Photoshop signed in to an Adobe account and an internet connection; uses generative credits
| Parameter | Type | Description |
|---|---|---|
prompt * | string | What to generate, in English |
contentType | string | Content type: none (automatic, default), photo or art |
seed | integer | Seed for repeatable results; -1 (default) picks one at random |
harmonize_layer Harmonize Layer
Harmonize a layer with the image beneath it (the Properties panel's Harmonize): match its light, colour and shadows to the background. Results go to a new layer. Needs Photoshop signed in to an Adobe account and an internet connection; uses generative credits
| Parameter | Type | Description |
|---|---|---|
seed | integer | Seed for repeatable results; -1 (default) picks one at random |
target | object | The layer to harmonize (the first one given). Default the active layer |
photoshop_status Photoshop Status
Check that Photoshop is reachable: platform, how the server addresses Photoshop, whether it is running, its version and open documents. Use this first when a call fails to connect
| Parameter | Type | Description |
|---|---|---|
probe | boolean | Ask Photoshop for its version and documents (starts Photoshop if it is not running). Default true |
play_action Play Action
Play an action from the Actions panel by its name and set. Dialogs in the action stay closed and use their recorded settings
| Parameter | Type | Description |
|---|---|---|
action * | string | Action name, e.g. "Vignette (selection)" |
set * | string | Action set name, e.g. "Default Actions" |
execute_photoshop_code Execute Photoshop Code
Run your own ExtendScript in Photoshop and return its last expression. It runs unrestricted: it can change or delete anything and read or write files. Prefer the specific tools
| Parameter | Type | Description |
|---|---|---|
code * | string | ExtendScript (ES3) source |
help Help
List the tools by area, or describe one tool's parameters
| Parameter | Type | Description |
|---|---|---|
tool | string | A tool name |