Channel
Represents a channel in a Photoshop document. You can access instances of channels using one of these methods:
// An array of component channels in the document
const componentChannels = app.activeDocument.componentChannels
// An array of active (selected) channels in the document
const activeChannels = app.activeDocument.activeChannels
// Reference a document's Red channel
const redChannel = app.activeDocument.channels[0]
Properties
Name
Type
Access
Min Version
Description
histogram
number[]
R
23.0
A histogram containing the number of pixels at each color intensity level for this channel. The array contains 256 members. The target channel must be visible.
name
string
R W
23.0
The name of the channel. For component channels this name can be localized. Fixes in Photoshop 24.6 - For component channel it is no longer converted into lowercase and is same as in UI - For component channel it will throw an error if channel no longer exist in document
opacity
number
R W
23.0
The opacity or solidity of the channel.
visible
boolean
R W
23.0
The visibility of the channel.
Methods
duplicate
<span class="minversion" style="display: block; margin-bottom: -1em; margin-left: 36em; float:left; opacity:0.5;">23.0</span>
<br/> async : Promise<void>
Duplicates the channel to the parent document, or a target document if specified.
// duplicate the channel
await channel.duplicate()
// duplicate to a different, compatible document
const newDoc = psApp.documents[1]
await channel.duplicate(newDoc)
Parameters
Name
Type
Description
merge
<span class="minversion" style="display: block; margin-bottom: -1em; margin-left: 36em; float:left; opacity:0.5;">23.0</span>
<br/> Promise<void>
Merges a Spot Color channel into the component channels.
remove
<span class="minversion" style="display: block; margin-bottom: -1em; margin-left: 36em; float:left; opacity:0.5;">23.0</span>
<br/> Promise<void>
Deletes the channel.