Copying and pasting channels - how to?
So I've got myself wrapped around the axle here trying to understand channels. I can't get my head around the fact that you can duplicate, add and remove, but you can't copy and paste channel contents? I'm working in JS in CS3. Or trying to.
I'm trying to take a gray image with three channels, and reduce it to two. Copy channel 2 into channel 1, copy channel 3 into 2, then delete channel 3 and save the file.
Why doesn't this work? I can copy and paste from artlayers so the method exists, but for whatever reason I can't get it to accept this method for channels:
// copy Alpha 1 and paste it into Gray
app.activeDocument.channel[2].copy();
app.activeDocument.channel[1].paste();
// copy Alpha 2 and paste it into Alpha 1
app.activeDocument.channel[3].copy();
app.activeDocument.channel[2].paste();
// Delete old Alpha 2 channel
app.activeDocument.channel[3].remove();
I tried another way - setting the active channel then copying and pasting, but I couldn't even get it to set the active channel without an error:
app.activeDocument.activeChannels = app.activeDocument.channel[2];
Very stuck and in need of help. Thanks.