Copy Layer Mask

As the subject suggests; I'm trying to find a way to copy a layer mask from one group to another.  I've looked around the web, but all I seem to find is a bunch of listener script that makes no sense, making it nearly impossible to get it to work for what I need.  I messed around with a layer script I have to copy layers between documents, but it doesn't seem to work the way I'd expect when trying to set it up for layer masks.  Anyway, the code I use for the layers is below.
                        var theCopyLayer = copyDoc.layers.getByName("Background");
                        var theCopiedLayer = theCopyLayer.duplicate(originalDoc.layerSets.getByName("stone").layers.getByName("mask"), ElementPlacement.PLACEBEFORE);
The layer mask I need is in the same document on a group; so the document switch isn't necessary.  Does anyone know of a way similar to this that would work for layer masks?  Or is the listener script the only option currently available?  Thanks!
dgolberg

but all I seem to find is a bunch of listener script that makes no sense
It may seem like it makes no sense, but that may not be easy to judge.
This function should work if you enter the (unique) name of the group the Layer Mask of which you want to duplicate onto the app.activeDocument.activeLayer.
function duplicateLayerMask (originLayerName) {
// =======================================================
var idMk = charIDToTypeID( "Mk  " );
    var desc2 = new ActionDescriptor();
    var idNw = charIDToTypeID( "Nw  " );
    var idChnl = charIDToTypeID( "Chnl" );
    desc2.putClass( idNw, idChnl );
    var idAt = charIDToTypeID( "At  " );
        var ref1 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idChnl = charIDToTypeID( "Chnl" );
        var idMsk = charIDToTypeID( "Msk " );
        ref1.putEnumerated( idChnl, idChnl, idMsk );
        var idLyr = charIDToTypeID( "Lyr " );
        var idOrdn = charIDToTypeID( "Ordn" );
        var idTrgt = charIDToTypeID( "Trgt" );
        ref1.putEnumerated( idLyr, idOrdn, idTrgt );
    desc2.putReference( idAt, ref1 );
    var idUsng = charIDToTypeID( "Usng" );
        var ref2 = new ActionReference();
        var idChnl = charIDToTypeID( "Chnl" );
        var idChnl = charIDToTypeID( "Chnl" );
        var idMsk = charIDToTypeID( "Msk " );
        ref2.putEnumerated( idChnl, idChnl, idMsk );
        var idLyr = charIDToTypeID( "Lyr " );
        ref2.putName( idLyr, originLayerName );
    desc2.putReference( idUsng, ref2 );
    var idDplc = charIDToTypeID( "Dplc" );
    desc2.putBoolean( idDplc, true );
executeAction( idMk, desc2, DialogModes.NO );

Similar Messages

  • How to select copy and paste an image that has a layer mask

    Hi,
    when I select, copy and paste the image it still has the content that I removed using the layer mask.
    I want to paste it over another psd whilst maintaing the transparency.
    Any help would be much appreciated.
    PSD is at
    http://sdrv.ms/16DoRft
    The small jpg is because I don't know what you will see in the skydrive psd
    Michael

    Wow that was so easy!
    Thanks!
    I spent at least half and hour trying to figure out why it wouldn't work.
    Michael

  • How can I Copy/Paste a Black & White Photo into a Layer Mask

    I have a landscape picture.
    Then I will copy it into another layer and convert it to black and white. I will make some changes to the B&W photo
    Then I want this B&W photo to be the layer mask of a "Layer-Multiply" of the original ...
    I tried copy and paste as it is, but it doesn´t works
    Please help me with the steps or what I am doing wrong.
    Regards
    Roberto

    You can paint not only a black and white photo, but also a coloured one.
    Once you have copied the photo (Ctrl A and Ctrl C), before trying to paste, be sure that the layer mask is active, Alt click in the layer palette in the mask icon on the right : you get a white screen and the mask icon is shown selected. Only then can you paste into the mask (Ctrl V). To exit the mask view, Alt click again or click in the layer icon on the left.
    When you paste a coloured pictures it is automatically converted to grayscale.

  • Copy and paste layer mask into another layer mask

    I know there is a way to do this.
    How can I copy and paste on layer mask into another.
    I need to use the same mask for multiple layers and images.
    Thanks

    In the same document, click on the layer mask, option drag to a new layer
    To copy mask to a different document with both documents open, select the layer, Duplicate Layer to the other document (destination). Then in the other document, option drag the mask to whatever layer you want, delete the layer you duplicated (you don't need it anymore, you just needed the mask)
    Or to copy mask to a different document with both documents open, load mask as a selection. Save selection to the other document (destination). Then in the other document load the new alpha channel and apply as a layer mask. Delete the alpha, you don't need it anymore.
    Edit: J always beats me to it

  • Copying a texture into a layer mask... how?

    This question has been plaguing me for years and I thought I'd come and finally scratch that itch once and for all.
    See this image? http://fc05.deviantart.net/fs42/f/2009/072/7/0/Grunge_Texture_by_skeelar_stock.jpg
    Say I want to use it as an opacity mask on a specific layer, or specific group of layers. How do I do it?
    I mean, I know I can select with the wand and then add a layer mask in the shape of whatever I selected, but the transparency/alpha info will be stripped. Portions of the mask will either be transparent or opaque.
    Copying a layer with gradients -- like a that of a worn-out paper texture -- into a layer mask is something I haven't been able to do. But I'm sure it can be done, because masks can do different levels of alpha just fine (they'd be pretty useless if they didn't).

    J Maloney wrote:
    Select all, Copy (or copy merged if you've got multiple layers) in the file you want to make into a mask. Go to the image in which you'd like to add the mask. Select the layer you'd like to mask. Create a layer mask. Make sure that mask is active by alt-clicking it. Paste.
    Whoa, that actually worked. Alt-clicking the mask is what did the trick.
    IMO, they should have made it work simply by clicking the mask and pasting into it. Having to alt-click it is, in my view, completely unnecessary. Not knowing that I had to hold down ALT has cost me who-knows-how-many hours over the years.
    But hey, that's how the program works so that's what I'm going to have to do from now on. Thanks, J!

  • How copy a layer and its layer mask to another image?

    Using PSE9, how can a copy a layer and its layer mask to another image?
    The on-line help contains a topic on how to copy a layer but trying the different methods in the help topic results in either nothing being copied or just the layer without its layer mask being copied.  Thanks.

    How are you copying?  If you float your images, so they are both partially visible in the work area, make the one with the to be copied layer active.  Then drag the layer from the layers palette onto the other image.  Now you should have both the layer and the mask on the second image.
    Juergen

  • PSE2.0.2, Copy adj. layer mask from 1 layer to another

    I just recently started using adjustment layers. I created a mask in levels adj. layer. I want to copy that mask to a new Bri&Contrast adj. layer.
    PSE 2.0.2 on Windows XP.
    Thanks for your help

    You can also create your B&C layer directly above the levels layer and go to layer>group with previous. Then any change to the levels mask will appear in the B&C layer as well. This only works if the layers can stay adjacent to each other, though.

  • Help with Photoshop CS2 files MUCH larger than normal, possibly not compessing layer masks

    Has anyone else come across a problem where Photoshop files grow in size much faster than expected, especially when adding layer masks?
    Normally when you add a layer mask the file size grow a small amount if the layer mask is mostly all white or mostly all black. In this case it's like the file size is growing exponentially, almost as if the layer mask isn't being compressed at all.
    The file in question although large, is similar dimensions, resolution, and number of layers as other projects that have been worked on and all the usual thing have been checked like resolution, colour mode, bit depth and the image has also been cropped so there's nothing outside of the page.
    The file has been checked on 2 different macs and exhibits the same behaviour and Photoshop preferences have been deleted and re-created and we've tried copying the file by dragging layers to a new document of the same dimensions with no success.
    The only things we're certain of is that file size grows dramatically when adding layer masks in particular and layers in general.
    The file was created by someone else, if that might be a factor, though the file has been "saved as.." with no improvement.
    Any ideas?
    TIA
    Tom
    The only

    Maybe it has something to do with "Maximize Compatibility". If that's checked when you save, it might add a lot of weight to your file, even with just a simple layer mask. Don't know, haven't done any testing, just a thought.
    Edit: Just did a quick test:
    1. flat image saved as PSD = 5.2 MB
    2. same image converted to a layer with simple layer mask, saved as PSD = 5.8 MB
    3. same layer mask image saved WITH "maximize compatibility" = 10.7 MB
    So adding "maximize compatibility" nearly doubled this test file. Could be it?

  • Why doesn't Photoshop always generate a layer mask

    I believe it was in CS4 that Adobe expanded the use of automatic layer masks ... perhaps it was with adjustment layers (I'm not quite sure)
    I don't know about others, but it would save me considerable time in the long run if every new layer, (whether it is generated as a copy, from a plug-in, as a cut, or as a new blank layer) recevied an automatic layer mask. It takes no file space, but more often than not I find myself needing one. It sure would be nice to jump right into masking rather than having to first create the layer mask. Why did they stop at adjustment layers?
    Am I alone in this?
    thanks

    Adding layers like Text, Raster and smart objects never have had automatic layers mask added.  Adding adjustment layers always came with an automatic layer mask until CS4.  Adode introduced bugs in CS4 when they added the adjustment panel these bugs have been carried forward into CS5 and CS6. Adobe added two options in the adjustment panels fly-out panel.  These options are designed to be global, not just adjustment panel options.  These options only work sometimes when changed from their default settings.  When changed from their default settings they try to change Photoshop historic default operation.  When you change Photoshop default operation Action, Scripts and Plug-ins that add adjustment layers may not work correctly.  Adobe should fix Photoshop and remove the two bad Adjustment Panel fly-out options. The Adjustment Panel fly-out menu option to not add Layer masks can not be safely set, same goes for the option to always clip added layer mask, if you use Actions, Scripts and Plug-ins that add adjustment layers.

  • Photoshop CS3 crashing when working on image with layer mask

    I've never had problems with Photoshop CS3 (or any other version) until now.
    Here's the problem:
    I created an image that has a layer mask applied to it. The image is saved in one layer (named Layer One) but not flattened in order to retain a transparent background. So far so good.
    But when I try to exapnd the canvas or make other changes to the image, it crashes. Repeatedly.
    Do I have to apply the mask (and thus give up the transparency) to prevent crashes?
    I did find a workaround. Applied the mask, made a cast drop shadow (which is what I was after all along), then copy-and-pasted the drop shadow into the original layer-masked image with transparent background.
    But is this the only way? Am I experiencing a bug or is something else wrong?
    Thanks!

    You create a new user account
    and it will show you where the corruption is. in the old user account or in the system or application.
    It a method of troubleshooting.

  • Why use layer masks and adjustment layers?

    I've been using PSE and CS successfully for years.
    One thing I have never understood is: why use layer masks and adjustment layers, instead of simply creating a copy of the subject layer (the one I want to make changes to) and experimenting with that?  It's quick (Ctrl-J), I can do it as many times as I want, I'm not affecting my Background layer.  If I like the changes, I can keep them.  I can switch the copy on and off to compare with the Background layer.  I can do any type of blend or combination I desire.  I can insert Gradient layer(s), select any part of the copy and (Ctrl-J) create a new layer containing only the selected part.  I can adjust size, rotate, do anything.
    It almost seems that "layer mask" and "adjustment layer" are mainly another layer of terminology; can anyone explain (preferably in 50 words or less) how they are intrinsically different from or superior to working with copies of the Background layer?  What can be done with them that can't be done simply using copies of the Background layer?

    Here's a very basic example of the advantage of using a layer mask.
    I have this picture of a sunflower and I want to convert the background to black & white, leaving just the flower in color.  I duplicated the Background layer, converted it to B&W and proceeded to use the Eraser to uncover the flower color. But I made a mistake and erased outside the flower.  There is no way to correct this other than deleting the layer and starting again.
    Now let's use a layer mask on the B&W layer. Set the Foreground/Background colors to the defaults black/white. Using the Brush tool paint on the mask with black to reveal the color.  Here I painted too far, revealing a green leaf in the background.  No need to start over.  Simply switch to white and paint the excess to convert back to the B&W.
    Tip: while painting you can type "X" to toggle between black and white.
    You could also select the flower using the various selection tools and then fill the selection with black. If it turns out the selection was not 100% accurate you can then fine-tune the result by painting on the mask with black or white as necessary.

  • Banding in the Layer Mask?

    Hello,
    I have:
    Windows Xp Service Pack 3
    4GB RAM
    Geforce 560ti
    PS CS5 extended
    I am a photographer and submit the images to an agency.They inspect images at 100% for technical quality.
    While preparing an image today, I used a layer mask in the levels adjustment.I used brush with 0% hardness and just clicked once with black color selected.But I found some severe banding.I alter clicked on the layer mask and found the same banding at 100%.I have not noticed such a thing till date.
    https://dl.dropbox.com/u/42878955/1.jpg
    I did try copy pasting the layer mask to show it to you guys, but when I saved it as jpeg and viewed the jpeg file, there was no banding.However I can see the banding even if view the jpeg of the image above.I tried on another images too but the same problem.It used to be very smooth before.Have made no changes to the default settings.Tried with both OpenGL on and off.
    Why does this happen?

    Noel Carboni wrote:
    c.pfaffenbichler wrote:
    When I set 16 bit in Camera Raw from the beginning and then opened in PS in 16 bit, and then did the same processing, I see the banding till I zoom in to 50% but not onwards 66.67%.
    So at Actual Pixels the problem is not visible in 16bit?
    Just FYI, layer combination for the Photoshop preview display is done for zoomed out levels in 8 bits, to optimize for speed, regardless of whether you're working in 16 bits/channel, unless you have the Cache Levels preference set to 1.
    Further info: at least with my GPU, layer combinations in 32 bits-per-channel mode remain unbanded (unquantized) at all zoom levels with multiple cache levels. I dare say there will be a performance hit in some cases but it looks really good.
    I would like to see an option in Preferences > Performance so the user can decide whether to sacrifice performance or display quality in greater than 8 bpc modes. In many cases, the reduced performance probably would be unnoticeable or negligible, whereas the reduced display quality can be very noticeable.

  • Blending with a layer mask question

    In CS5, I make a selection and copy it to a new layer and use the bloat tool to manipulate the layer, I then select the new layer mask with this new bloated layer and use the brush tool with the airbrush turned on to blend in this new layer with the original layer.
    However, I am just not sure I understand what this is doing.
    1. How is using the layer mask to blend it in different from just using ther eraser tool to erase parts of it?
    Thanks.

    I don't get the impression you fully understand the concept of the layer mask.  Using a brush on the layer mask does nothing to the layer itself. Think  of it like a window through which you see the layer. Paint part of the  window black and you can't see the layer underneath. Scrape the paint  off, and voila. You now see again what was there.

  • Switch image in a layer but keep the layer mask

    Hi, I`m trying to swich a image on a layer whit a layer mask. I whant to keep the layer mask but change the image. When I paste a copyed image it the laye it creates a hole new layer. How can I change a image but keep the layer mask? 
    Tanks Lasse

    You have things backwards: You copy&paste the layer mask and/or duplicate a selection by loading it using Ctrl+click on the thumbnail, then creating a new mask from it. After that you can delete the original layer. Also more recent versions allow drag&drop replacement of this stuff, but you have to be careful which thumbnail you drag...
    Mylenium

  • Layer mask is turning skin Gray

    I have used the same basic skin retouching method for hundreds of pictures. Usually I end up with very nice, natural looking skin.  Today, the same technique is turning the skin gray on any picture I attempt to use it on. I cannot figure out why.  Essentially, I copy the background layer.  I do my spot healing on this layer. When I'm through, I make 3 more layers.  On the first, I use the Median filter. On the second, I use a high pass filter.  Then on the 3rd, I add I layer mask, painting in black, and go over the skin. It is always gray on the mask.  I then go back and reduce the opacity of the high pass and median layers.  Usually I end up with smoother, but natural skin and it's normal color.  Today, every time I attempt to do this, the skin stays a muted gray.  I cannot figure out why.  Does anyone have any suggestions as to what might be different that I'm not noticing?  Thanks. 

    Figured it out finally.  For some reason the high pass kept slipping out of overlay mode into normal mode.  Problem solved.

Maybe you are looking for

  • How do I export a menu created in Premiere Pro CS5 to Adobe Encore CS5?

    Hey everyone, First time in here.  Trying some new things in CS5.  Anyway, I created a working DVD menu in Photoshop and brought it into Premiere to lay in some video and music.  The video is an inset that moves from left to right and sits atop the b

  • JDeveloper 10.1.2.1 won't compile my code?

    Hi, I'm pretty new to JDeveloper, and Java in general. I've just downloaded and tried to run JDeveloper 10g (10.1.2.1.0, Build 1913) and I've having problems. When the application loads, I get a dialog message titled "Java Virtual Machine Launcher",

  • (Big) iPhoto Library opening empty from external drive

    I need help! I have a new 2014 MacBook running Yosemite, as well as an older MacBookPro. I copied my large iPhoto Library from old laptop (labeled old library "iPhoto Pics 2008-2014", or similar) onto an external drive so that I could access all my p

  • ERROR report when backing up of ipad

    I get repeated error reports when backing ipad only when trying to update to ios 5. when I back up without update option it works fine i have version 4.3.1 and want to update it.help!

  • Correct IP address from router, no internet connection

    I setup a network with four PCs. Three of the PCs are connected directly to the router, and one is connected wirelessly. The three PCs wired in are working just fine, but the wireless one is not. When I first set up the connection, I had an internet