CalculationsOptions
An object literal can be constructed with the following properties and passed to Document.calculations. As a type, CalculationsOptions can be used in Typescript development.
const options = {
source1: {
document: doc,
layer: doc.layers[0],
channel: CalculationsChannel.GRAY
invert: true
},
source2: {
document: doc,
layer: CalculationsLayer.MERGED,
channel: doc.channels[2]
},
blending: CalculationsBlendMode.DARKEN,
opacity: 50,
result: CalculationsResult.NEWCHANNEL
};
await require('photoshop').app.activeDocument.calculations(options);
Name
Type
Default
Range
Min Version
Description
blending
MULTIPLY
-
24.5
The blend mode used to merge "Source 1" and "Source 2" together. "Source 1" will be rendered above "Source 2"
opacity
number
100
0..100
24.5
The opacity used for "Source 1" when merged with "Source 2".
source1
-
-
24.5
The "Source 1" reference to be used in the Calculations operation. "Source 1" will be rendered above "Source 2"
source2
-
-
24.5
The "Source 2" reference to be used in the Calculations operation