copy/paste w/alpha (was: resize w/alpha)

Discussion of actual or possible Photoshop Scripting Bugs, Anomalies and Documentation Errors

Moderators: Tom, Kukurykus

bjorke

copy/paste w/alpha (was: resize w/alpha)

Post by bjorke »

I'm experiencing this in CS2

Is there any known workaround short of copying these channels to additional images as RGB channels, resizing them and pasting them back into the resized copy of the original document as alpha channels?

thanks
KB
Mike Hale

copy/paste w/alpha (was: resize w/alpha)

Post by Mike Hale »

There does seem to be a resize bug in CS2.

MickM reported it here bb/viewtopic.php?t=46

You may want to look there to see if the workaround posted will help.

I did a short test here and the workaround did resample the alpha channels correctly for me

Mike
bjorke

copy/paste w/alpha (was: resize w/alpha)

Post by bjorke »

I don't think this is the same bug. I will try to isolate it....

My mistake, it's not a resize bug! It's the fact that copy-paste only copy-pastes RGB -- even if the alpha channel is extend-selected. You can verify this easily by hand, no scripting required.

Will see if I can duplicate the copy-paste shuffle for each individual channel, as a workaround.
Mike Hale

copy/paste w/alpha (was: resize w/alpha)

Post by Mike Hale »

I'm not sure what it is that you are trying to do now. I had thought that you were having problems with the fact that resize doesn't always resize a alpha channel.

If you are trying to make a copy of the doc you could use activeDocument.duplicate();

Mike
Norbert

copy/paste w/alpha (was: resize w/alpha)

Post by Norbert »

You can Copy and Past an Alpha Channel.
You must have two images open and each one has to have an alpha channel.
Select All with the channel layer active and copy then past it into the other image and it will replace the one already there.

On the other hand if you want only the alpha in one document resized just resize it like you rezize any layer with Edit-Resize or duplicate it and resize the duplicate.

Do I understand what you want to accomplish?
Guest

copy/paste w/alpha (was: resize w/alpha)

Post by Guest »

so how do I force the additional channels to be selected, from a script?

thanks
Mike Hale

copy/paste w/alpha (was: resize w/alpha)

Post by Mike Hale »

In javascript use this to select all the channels;

Code: Select allvar addChannelIndex = 0;
var channelSelection = new Array();
for(var channelIndex = 0; channelIndex < app.activeDocument.channels.length;
channelIndex++) {
channelSelection[addChannelIndex++] = app.activeDocument.channels[channelIndex]
}
app.activeDocument.activeChannels = channelSelection;

edit: This only works with docs with only a background layer. If there are more than one layer or the single layer is not a background layer, only the alpha channels are selected.???
Guest

copy/paste w/alpha (was: resize w/alpha)

Post by Guest »

Thanks! -- I didn't realize I could just arbitrarily re-assign the active channels array... thought I could only tweak the contents of members.

kb