Copy link to clipboard
Copied
I'm working on a project where I am creating a number of Alpha Channels, which will subsequently be combined using Calculations. If I click on the New Channel icon in the Channels panel, I get a visible new channel, but all other channels become hidden. If I select New Channel from the Channels panel menu, the currently visible channels remain visible, but the new channel is hidden. How can I get a visible new channel with all the currently visible channels remaining so?
Try this script to create a new, blank channel.
#target photoshop
var doc = activeDocument;
doc.channels.add();
for(var i = 0;i<doc.channels.length;i++){
doc.channels.visible = true;
}
Copy link to clipboard
Copied
Try this script to create a new, blank channel.
#target photoshop
var doc = activeDocument;
doc.channels.add();
for(var i = 0;i<doc.channels.length;i++){
doc.channels.visible = true;
}
Copy link to clipboard
Copied
Great! Can it be made so "Color indicates Selected Area", rather than Masked Area?
Copy link to clipboard
Copied
I'm not sure. I'll have to look into that. that might be a pref outside of the script.
Copy link to clipboard
Copied
Found it. Here's the new code:
#target photoshop
var doc = activeDocument;
var newChannel = doc.channels.add();
newChannel.kind= ChannelType.SELECTEDAREA
for(var i = 0;i<doc.channels.length;i++){
doc.channels.visible = true;
}
Copy link to clipboard
Copied
I'll give it a try. I made an Action that runs your first script, and then sets Channel Options, and that works, too.
Copy link to clipboard
Copied
Semaphoric wrote
I'm working on a project where I am creating a number of Alpha Channels,
Be careful about the number of Alpha channels you create. Delete any you will not use after you combine them. Photoshop only support up to 53 Alpha channels. I found that out the hard way my scripts failed when they they tried to create the 54 alpha channel. I had to add code to catch this limit.
Copy link to clipboard
Copied
That's good to know. I remember the old 100 layer limit, which turned out to be artificial. I wonder if 53 Alphas is, too.
If needed, I suppose I could just use a second doc to store them.
Copy link to clipboard
Copied
I found no way around the 53 Alpha channel limit. I based my Photo Collage Toolkit on my simple template design. Templates simple to create that would be populated automatically withe the toolkit's scripts. Image were simply mapped by Alpha Channels. These Alpha channels bounds were used to scale the Placed smart Object image layers transform to size aligned to the alpha channel and than mask to its shaped. Everything work great till I tried to create a collage with more than 53 images. I had to note the 53 limit and change the scripts to catch the limit. The only script capable of more than 53 images in my toolkit is PasteImageroll. It does not use a template it can populate any number of image and create a document canvas size the selected images will fit in. The image are fitted and masked to a tile size you set.
53 Alpha channels is Photoshop's limit....
Copy link to clipboard
Copied
JJMack wrote
I found no way around the 53 Alpha channel limit.
I suppose you could work around the limit by converting and storing the additional alpha channels as masks on an empty layer - loading them back in as Alpha when required, or using calculations straight on the masks
Dave
Copy link to clipboard
Copied
Or you could store them as different rib channels on multiple layers.
Copy link to clipboard
Copied
The whole reason for using Alpha channels in the first place was for template simplicity not have to have layers to hold images or act as clipping mask all a script has to do is count the number of Image Alpha channels then place in that many image files above the required Background layer. Any layer in a template above the background layer would be overlay layers to enhance the images that will be place by a scripting. These Template psd files are easy to create and populating them is a straight forward scripting task. The Idea is was not to have a complex template design To get around Photoshop's Alpha channel limit which I did not know was so low would add complexity I absolutely do not want in template design.
Copy link to clipboard
Copied
I understand that JJMack, I was not suggesting you did it.
It was just me trying to think around the barrier in case anyone else faced it. I was thinking of situations where a group of layers could act as a temporary "store" for excess Alpha channels.
Dave
Copy link to clipboard
Copied
Yes you can have 8000 layers and each layer can havs a Raster layer Mask whch are channels like alpha channel but are only listed/shown in the channel palette when the its layer is the current Photoshop target layer the other are like hidden alpha channels. However, you can only cereate 53 channels with names. So you can have 8000 channels associated with layers but you can only access them by making the layer they are on the actuve layer thel load its layer mask channel as a selection. Each requaries a layer of Group to be on..
Copy link to clipboard
Copied
But like I said, you can store them in another doc, as long as both are open at the same time.