Layer Object Simplified Format

Used by the following creative scripts:

Simplified format

Defined as a JSON object:

{
    "adjustmentLayer": adjustmentLayer
}

or
{
    "contentLayer": contentLayer
}

or
{
    "layer": layer
}

or
{
    "layerSection": layerSection
}

adjustmentLayer : JSON object in Layer properties format
contentLayer : JSON object in Layer properties format
layer : JSON object in Layer properties format
layerSection : JSON object in Layer properties format

Layer properties

Defined as a JSON object:

{
    "name": name,
    "color": color,
    "layerLocking": layerLocking,
    "group": group,
    "mode": mode,
    "opacity": opacity,
    "fillNeutral": fillNeutral,
    "fillOpacity": fillOpacity,
    "channelRestrictions": channelRestrictions,
    "knockout": knockout,
    "blendInterior": blendInterior,
    "blendClipped": blendClipped,
    "transparencyShapesLayer": transparencyShapesLayer,
    "layerMaskAsGlobalMask": layerMaskAsGlobalMask,
    "vectorMaskAsGlobalMask": vectorMaskAsGlobalMask,
    "blendRange": blendRange,
    "type": type,
    "userMaskDensity": userMaskDensity,
    "userMaskFeather": userMaskFeather,
    "vectorMaskDensity": vectorMaskDensity,
    "vectorMaskFeather": vectorMaskFeather
}

name : [optional] string
color : [optional] string (among "none", "red", "orange", "yellowColor", "green", "blue", "violet", "gray")
layerLocking : [optional] JSON object in Layer locking format
group : [optional] boolean
mode : [optional] string (among Blend modes)
opacity : [optional] number (percentage; 0% to 100%)
fillNeutral : [optional] boolean
fillOpacity : [optional] number (percentage; 0% to 100%)
channelRestrictions : [optional] JSON array of strings (among Channels)
knockout : [optional; "none" by default] string (among "none", "shallow", "deep")
blendInterior : [optional] boolean
blendClipped : [optional; true by default] boolean
transparencyShapesLayer : [optional; true by default] boolean
layerMaskAsGlobalMask : [optional] boolean
vectorMaskAsGlobalMask : [optional] boolean
blendRange : [optional] JSON array in Blend range list format
type : [optional] JSON object in Layer type format (only for "adjustmentLayer" or "contentLayer")
userMaskDensity : [optional] number (percentage; 0% to 100%)
userMaskFeather : [optional] number (0 to 250 pixels)
vectorMaskDensity : [optional] number (percentage; 0% to 100%)
vectorMaskFeather : [optional] number (0 to 250 pixels)

Layer locking

Defined as a JSON object:

{
    "protectAll": protectAll,
    "protectComposite": protectComposite,
    "protectPosition": protectPosition,
    "protectTransparency": protectTransparency
}

protectAll : [optional] boolean
protectComposite : [optional] boolean
protectPosition : [optional] boolean
protectTransparency : [optional] boolean

Layer type

A layer type can be one of the following:

Black & white adjustment

Defined as a JSON object:

{
    "blackAndWhite":
    {
        "red": red,
        "yellow": yellow,
        "green": green,
        "cyan": cyan,
        "blue": blue,
        "magenta": magenta,
        "useTint": useTint,
        "tintColor": tintColor,
        "using": using
    }
}

red : [optional] number (-200 to 300)
yellow : [optional] number (-200 to 300)
green : [optional] number (-200 to 300)
cyan : [optional] number (-200 to 300)
blue : [optional] number (-200 to 300)
magenta : [optional] number (-200 to 300)
useTint : [optional] boolean (false by default)
tintColor : [optional] JSON object in Color format (only if useTint is true)

using : [optional] adjustment preset file path string (.blw)

Brightness/contrast adjustment

Defined as a JSON object:

{
    "brightnessContrast":
    {
        "brightness": brightness,
        "contrast": contrast,
        "useLegacy": useLegacy
    }
}

brightness : [optional] number (-100 to 100 if useLegacy is true or undefined; -150 to 150 otherwise)
contrast : [optional] number (-100 to 100 if useLegacy is true or undefined; -50 to 100 otherwise)
useLegacy : [optional] boolean (true by default)

Channel mixer adjustment

Defined as a JSON object:

{
    "channelMixer":
    {
        "red": red,
        "green": green,
        "blue": blue,
        "cyan": cyan,
        "magenta": magenta,
        "yellowColor": yellowColor,
        "black": black,
        "gray": gray,
        "monochromatic": monochromatic,
        "using": using
    }
}

red : [optional] JSON object in Channel Matrix format
green : [optional] JSON object in Channel Matrix format
blue : [optional] JSON object in Channel Matrix format

cyan : [optional] JSON object in Channel Matrix format
magenta : [optional] JSON object in Channel Matrix format
yellowColor : [optional] JSON object in Channel Matrix format
black : [optional] JSON object in Channel Matrix format

gray : [optional] JSON object in Channel matrix format (only if monochromatic is true)

monochromatic : [optional] boolean (false by default)

using : [optional] adjustment preset file path string (.cha)

Channel matrix

Defined as a JSON object:

{
    "red": red,
    "green": green,
    "blue": blue,
    "cyan": cyan,
    "magenta": magenta,
    "yellowColor": yellowColor,
    "black": black,
    "constant": constant
}

red : [optional] number (-200 to 200)
green : [optional] number (-200 to 200)
blue : [optional] number (-200 to 200)

cyan : [optional] number (-200 to 200)
magenta : [optional] number (-200 to 200)
yellowColor : [optional] number (-200 to 200)
black : [optional] number (-200 to 200)

constant : [optional] number (-200 to 200)

Color balance adjustment

Defined as a JSON object:

{
    "colorBalance":
    {
        "shadowLevels": shadowLevels,
        "midtoneLevels": midtoneLevels,
        "highlightLevels": highlightLevels,
        "preserveLuminosity": preserveLuminosity
    }
}

shadowLevels : [optional] JSON array of numbers (-100 to 100)
midtoneLevels : [optional] JSON array of numbers (-100 to 100)
highlightLevels : [optional] JSON array of numbers (-100 to 100)
preserveLuminosity : [optional] boolean

Curves adjustment

Defined as a JSON object:

{
    "curves":
    {
        "adjustment": adjustment,
        "using": using
    }
}

adjustment : [optional] JSON array in Curves adjustment list format

using : [optional] adjustment preset file path string (.acv or .amp)

Curves adjustment list

JSON array of curves adjustments, each one being a JSON object:

either:
{
    "channel": channel,
    "curve": curve
}

or:
{
    "channel": channel,
    "mapping": mapping
}

channel : string (among Channels)

curve : [optional] JSON array of JSON objects, each one being in Point format
mapping : [optional] JSON array of 256 numbers (0 to 255)

Exposure adjustment

Defined as a JSON object:

{
    "exposure":
    {
        "exposure": exposure,
        "offset": offset,
        "gammaCorrection": gammaCorrection,
        "using": using
    }
}

exposure : [optional] number (-20.0 to 20.0; 0.0 by default)
offset : [optional] number (-0.5 to 0.5; 0.0 by default)
gammaCorrection : [optional] number (0.01 to 9.99; 1.0 by default)

using : [optional] adjustment preset file path string (.eap)

Gradient map adjustment

Defined as a JSON object:

{
    "gradientMapClass":
    {
        "gradient": gradient,
        "dither": dither,
        "reverse": reverse
    }
}

gradient : JSON object in Gradient format
dither : [optional] boolean (false by default)
reverse : [optional] boolean (false by default)

Hue/saturation adjustment

Defined as a JSON object:

{
    "hueSaturation":
    {
        "adjustment": adjustment,
        "colorize": colorize,
        "using": using
    }
}

adjustment : [optional] JSON array in Hue/saturation adjustment list format
colorize : [optional] boolean (false by default)

using : [optional] adjustment preset file path string (.ahu)

Hue/saturation adjustment list

JSON array of hue/saturation adjustments, each one being a JSON object:

{
    "hue": hue,
    "saturation": saturation,
    "lightness": lightness
}

or:
{
    "channel": channel,
    "hue": hue,
    "saturation": saturation,
    "lightness": lightness
}

or:
{
    "localRange": localRange,
    "beginRamp": beginRamp,
    "beginSustain": beginSustain,
    "endSustain": endSustain,
    "endRamp": endRamp,
    "hue": hue,
    "saturation": saturation,
    "lightness": lightness
}

hue : number (-180 to 180, or 0 to 360 if colorize is true)
saturation : number (-100 to 100, or 0 to 100 if colorize is true)
lightness : number (-100 to 100)

channel : [optional] string ("composite"; only if colorize is true)

localRange : [optional] number (1 for reds, 2 for yellows, 3 for greens, 4 for cyans, 5 for blues, 6 for magentas)
beginRamp : [optional] number (0 to 360)
beginSustain : [optional] number (0 to 360)
endSustain : [optional] number (0 to 360)
endRamp : [optional] number (0 to 360)

Invert adjustment

Defined as a JSON object:

{
    "invert": null
}

Levels adjustment

Defined as a JSON object:

{
    "levels":
    {
        "adjustment": adjustment,
        "using": using
    }
}

adjustment : [optional] JSON array in Levels adjustment list format

using : [optional] adjustment preset file path string (.alv)

Levels adjustment list

JSON array of levels adjustments, each one being a JSON object:

{
    "channel": channel,
    "input": input,
    "gamma": gamma,
    "output": output,
    "auto": output,
    "autoContrast": output,
    "autoNeutrals": autoNeutrals,
    "autoBlackWhite": autoBlackWhite,
    "blackClip": blackClip,
    "whiteClip": whiteClip
}

channel : string (among Channels)

input : [optional] JSON array of 2 numbers (0 to 255; [ 0, 255 ] by default)
gamma : [optional] number (0.01 to 9.99; 1.0 by default)
output : [optional] JSON array of 2 numbers (0 to 255; [ 0, 255 ] by default)

auto : [optional] boolean
autoContrast : [optional] boolean
autoNeutrals : [optional] boolean
autoBlackWhite : [optional] boolean
blackClip : [optional] number (0.0 to 9.99; 0.1 by default)
whiteClip : [optional] number (0.0 to 9.99; 0.1 by default)

Photo filter adjustment

Defined as a JSON object:

{
    "photoFilter":
    {
        "color": color,
        "density": density,
        "preserveLuminosity": preserveLuminosity
    }
}

color : JSON object in Color format
density : [optional] number (1% to 100%; 25% by default)
preserveLuminosity : [optional] boolean (true by default)

Posterize adjustment

Defined as a JSON object:

{
    "posterize":
    {
        "levels": levels
    }
}

levels : [optional] number (2 to 255; 4 by default)

Selective color adjustment

Defined as a JSON object:

{
    "selectiveColor":
    {
        "colorCorrection": colorCorrection,
        "method": method,
        "using": using
    }
}

colorCorrection : [optional] JSON array in Color correction list format
method : [optional] string (either "absolute or "relative"; "relative" by default)

using : [optional] adjustment preset file path string (.asv)

Color correction list

JSON array of color corrections, each one being a JSON object:

{
    "colors": colors,
    "cyan": cyan,
    "magenta": magenta,
    "yellowColor": yellowColor,
    "black": black
}

colors : string (among "reds", "yellows", "greens", "cyans", "blues", "magentas", "whites", "neutrals", "blacks")
cyan : [optional] number (-100% to 100%; 0% by default)
magenta : [optional] number (-100% to 100%; 0% by default)
yellowColor : [optional] number (-100% to 100%; 0% by default)
black : [optional] number (-100% to 100%; 0% by default)

Threshold adjustment

Defined as a JSON object:

{
    "thresholdClassEvent":
    {
        "level": level
    }
}

level : [optional] number (1 to 255; 128 by default)

Vibrance adjustment

Defined as a JSON object:

{
    "vibrance":
    {
        "vibrance": vibrance,
        "saturation": saturation
    }
}

vibrance : [optional] number (-100 to 100; 0 by default)
saturation : [optional] number (-100 to 100; 0 by default)

Gradient fill

Defined as a JSON object:

{
    "gradientLayer":
    {
        "gradient": gradient,
        "type": type,
        "angle": angle,
        "scale": scale,
        "reverse": reverse,
        "dither": dither,
        "align": align,
        "offset": offset
    }
}

gradient : JSON object in Gradient format
type : [optional] string (among "linear", "radial", "angle", "reflected", "diamond")
angle : [optional] number (-180° to 180°)
scale : [optional] number (percentage; 10% to 150%)
reverse : [optional] boolean (false by default)
dither : [optional] boolean (false by default)
align : [optional] boolean (true by default)
offset : [optional] JSON object in Point format

Pattern fill

Defined as a JSON object:

{
    "patternLayer":
    {
        "pattern": pattern,
        "scale": scale,
        "align": align,
        "phase": phase
    }
}

pattern : JSON object in Pattern format
scale : [optional] number (percentage; 1% to 1000%; 100% by default)
align : [optional] boolean (true by default)
phase : [optional] JSON object in Point format

Solid color fill

Defined as a JSON object:

{
    "solidColorLayer":
    {
        "color": color
    }
}

color : JSON object in Color format

Blend range list

JSON array of blend ranges, each one being a JSON object:

{
    "channel": channel,
    "srcBlackMin": srcBlackMin,
    "srcBlackMax": srcBlackMax,
    "srcWhiteMin": srcWhiteMin,
    "srcWhiteMax": srcWhiteMax,
    "destBlackMin": destBlackMin,
    "destBlackMax": destBlackMax,
    "destWhiteMin": destWhiteMin,
    "destWhiteMax": destWhiteMax,
}

channel : string (among Channels)
srcBlackMin : number (0 to 255)
srcBlackMax : number (0 to 255)
srcWhiteMin : number (0 to 255)
srcWhiteMax : number (0 to 255)
destBlackMin : number (0 to 255)
destBlackMax : number (0 to 255)
destWhiteMin : number (0 to 255)
destWhiteMax : number (0 to 255)

Color

A color can be one of the following:

Book color

{
    "book": book,
    "name": name,
    "bookID": bookID,
    "bookKey": bookKey
}

or

{
    "book": book,
    "name": name
}

or

{
    "bookID": bookID,
    "bookKey": bookKey
}

book : string
name : string
bookID : number
bookKey : string

CMYK color

{
    "cyan": cyan,
    "magenta": magenta,
    "yellowColor": yellowColor,
    "black": black
}

cyan : number (percentage; 0% to 100%)
magenta : number (percentage; 0% to 100%)
yellowColor : number (percentage; 0% to 100%)
black : number (percentage; 0% to 100%)

Grayscale

{
    "gray": gray
}

gray : number (percentage; 0% to 100%)

HSB color

{
    "hue": hue,
    "saturation": saturation,
    "brightness": brightness
}

hue : number (0° to 360°)
saturation : number (percentage; 0% to 100%)
brightness : number (percentage; 0% to 100%)

Lab color

{
    "luminance": luminance,
    "a": a,
    "b": b
}

luminance : number (0 to 100)
a : number (-128 to 127)
b : number (-128 to 127)

RGB color

{
    "red": red,
    "green": green,
    "blue": blue
}

red : number (0 to 255)
green : number (0 to 255)
blue : number (0 to 255)

Gradient

A gradient can be either a Solid gradient or a Noise gradient.

Solid gradient

{
    "name": name,
    "gradientForm": "customStops",
    "interpolation": interpolation,
    "colors": colors,
    "transparency": transparency
}

name : string (gradient name) or null (in input)
interpolation : number (0 to 4096)
colors : JSON array in Color stop list format
transparency : JSON array in Transparency stop list format

Noise gradient

{
    "name": name,
    "gradientForm": "colorNoise",
    "smoothness": smoothness,
    "colorSpace": colorSpace,
    "minimum": minimum,
    "maximum": maximum,
    "vectorColor": vectorColor,
    "showTransparency": showTransparency,
    "randomSeed": randomSeed
}

name : string (gradient name) or null (in input)
smoothness : number (0 to 4096)
colorSpace : string (among "RGBColor", "HSBColorEnum", "labColor")
minimum : JSON array of 4 numbers, i.e., three color components (0 to 100) + transparency (0)
maximum : JSON array of 4 numbers, i.e., three color components (0 to 100) + transparency (100)
vectorColor : boolean
showTransparency : boolean
randomSeed : number

Color stop list

JSON array of color stops, each one being a JSON object:

{
    "location": location,
    "midpoint": midpoint,
    "type": type,
    "color": color
}

location : number (0 to 4096)
midpoint : number (percentage; 0% to 100%)
type : string (among "foregroundColor", "backgroundColor", "userStop")
color : [optional; only if type is "userStop"] JSON object in Color format

Transparency stop list

JSON array of transparency stops, each one being a JSON object:

{
    "location": location,
    "midpoint": midpoint,
    "opacity": opacity
}

location : number (0 to 4096)
midpoint : number (percentage: 0% to 100%)
opacity : number (percentage: 0% to 100%)

Pattern

{
    "name": name,
    "ID": ID
}

name : string
ID : string (UUID)

Point

{
    "horizontal": horizontal,
    "vertical": vertical
}

horizontal : number
vertical : number

Blend modes

  • “normal”
  • “dissolve”
  • “darken”
  • “multiply”
  • “colorBurn”
  • “linearBurn”
  • “darkerColor”
  • “lighten”
  • “screen”
  • “colorDodge”
  • “linearDodge”
  • “lighterColor”
  • “overlay”
  • “softLight”
  • “hardLight”
  • “vividLight”
  • “linearLight”
  • “pinLight”
  • “hardMix”
  • “difference”
  • “exclusion”
  • “subtract”
  • “divide”
  • “hue”
  • “saturation”
  • “color”
  • “luminosity”

Channels

  • “a”
  • “b”
  • “black”
  • “blue”
  • “composite”
  • “cyan”
  • “duotone”
  • “gray”
  • “green”
  • “lightness”
  • “magenta”
  • “monotone”
  • “quadtone”
  • “red”
  • “tritone”
  • “yellow”

Tags: , , , , , ,

Comments are closed.