Blending Options Object Simplified Format

Used by the following utility scripts:

Used also by the creative script:

Simplified format

Defined as a JSON object:

{
    "mode": mode,
    "opacity": opacity,
    "fillOpacity": fillOpacity,
    "channelRestrictions": channelRestrictions,
    "knockout": knockout,
    "blendInterior": blendInterior,
    "blendClipped": blendClipped,
    "transparencyShapesLayer": transparencyShapesLayer,
    "layerMaskAsGlobalMask": layerMaskAsGlobalMask,
    "vectorMaskAsGlobalMask": vectorMaskAsGlobalMask,
    "blendRange": blendRange
}

mode : [optional] string (among Blend modes)
opacity : [optional] number (percentage; 0% to 100%)
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

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”

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)

Channels

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

Default values

Whenever a blending option is not defined, a default value is always assumed, in input as well as in output.
Default values related to channels, i.e., "channelRestrictions" and "blendRange", are specific to the document’s color space (among: CMYK, Duotone, Grayscale, Lab, RGB):

CMYK document

Default Blending Options (CMYK)
Default Blending Options (CMYK) (Cyan)
Default Blending Options (CMYK) (Magenta)
Default Blending Options (CMYK) (Yellow)
Default Blending Options (CMYK) (Black)

{
    "mode": "normal",
    "opacity": 100,
    "fillOpacity": 100,
    "channelRestrictions":
    [
        "cyan",
        "magenta",
        "yellow",
        "black"
    ],
    "knockout": "none",
    "blendInterior": false,
    "blendClipped": true,
    "transparencyShapesLayer": true,
    "layerMaskAsGlobalMask": false,
    "vectorMaskAsGlobalMask": false,
    "blendRange":
    [
        {
            "channel": "gray",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        },
        {
            "channel": "cyan",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        },
        {
            "channel": "magenta",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        },
        {
            "channel": "yellow",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        },
        {
            "channel": "black",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        }
    ]
}

Duotone document

Default Blending Options (Duotone)

{
    "mode": "normal",
    "opacity": 100,
    "fillOpacity": 100,
    "channelRestrictions":
    [
        "black"
    ],
    "knockout": "none",
    "blendInterior": false,
    "blendClipped": true,
    "transparencyShapesLayer": true,
    "layerMaskAsGlobalMask": false,
    "vectorMaskAsGlobalMask": false,
    "blendRange":
    [
        {
            "channel": "black",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        }
    ]
}

Grayscale document

Default Blending Options (Grayscale)

{
    "mode": "normal",
    "opacity": 100,
    "fillOpacity": 100,
    "channelRestrictions":
    [
        "black"
    ],
    "knockout": "none",
    "blendInterior": false,
    "blendClipped": true,
    "transparencyShapesLayer": true,
    "layerMaskAsGlobalMask": false,
    "vectorMaskAsGlobalMask": false,
    "blendRange":
    [
        {
            "channel": "black",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        }
    ]
}

Lab document

Default Blending Options (Lab)
Default Blending Options (Lab) (A)
Default Blending Options (Lab) (B)

{
    "mode": "normal",
    "opacity": 100,
    "fillOpacity": 100,
    "channelRestrictions":
    [
        "lightness",
        "a",
        "b"
    ],
    "knockout": "none",
    "blendInterior": false,
    "blendClipped": true,
    "transparencyShapesLayer": true,
    "layerMaskAsGlobalMask": false,
    "vectorMaskAsGlobalMask": false,
    "blendRange":
    [
        {
            "channel": "lightness",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        },
        {
            "channel": "a",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        },
        {
            "channel": "b",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        }
    ]
}

RGB document

Default Blending Options (RGB)
Default Blending Options (RGB) (Red)
Default Blending Options (RGB) (Green)
Default Blending Options (RGB) (Blue)

{
    "mode": "normal",
    "opacity": 100,
    "fillOpacity": 100,
    "channelRestrictions":
    [
        "red",
        "green",
        "blue"
    ],
    "knockout": "none",
    "blendInterior": false,
    "blendClipped": true,
    "transparencyShapesLayer": true,
    "layerMaskAsGlobalMask": false,
    "vectorMaskAsGlobalMask": false,
    "blendRange":
    [
        {
            "channel": "gray",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        },
        {
            "channel": "red",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        },
        {
            "channel": "green",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        },
        {
            "channel": "blue",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        }
    ]
}

Examples

{
    "fillOpacity": 70,
    "blendInterior": true
}

Blending Options Example 1

{
    "mode": "colorDodge",
    "opacity": 75,
    "fillOpacity": 50,
    "channelRestrictions":
    [
        "red",
        "blue"
    ],
    "knockout": "shallow",
    "blendInterior": true,
    "blendClipped": false,
    "transparencyShapesLayer": false,
    "layerMaskAsGlobalMask": true,
    "vectorMaskAsGlobalMask": true,
    "blendRange":
    [
        {
            "channel": "gray",
            "srcBlackMin": 10,
            "srcBlackMax": 20,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 235,
            "destWhiteMax": 245
        },
        {
            "channel": "red",
            "srcBlackMin": 80,
            "srcBlackMax": 80,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        },
        {
            "channel": "green",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 0,
            "destBlackMax": 0,
            "destWhiteMin": 160,
            "destWhiteMax": 255
        },
        {
            "channel": "blue",
            "srcBlackMin": 0,
            "srcBlackMax": 0,
            "srcWhiteMin": 255,
            "srcWhiteMax": 255,
            "destBlackMin": 80,
            "destBlackMax": 80,
            "destWhiteMin": 255,
            "destWhiteMax": 255
        }
    ]
}

Blending Options Example 2 (Gray)
Blending Options Example 2 (Red)
Blending Options Example 2 (Green)
Blending Options Example 2 (Blue)

Tags: , , , , ,

Comments are closed.