Technique question: Paste mask?

Talk about Pixelmator Pro, share tips & tricks, tutorials, and other resources.
User avatar

2020-12-16 13:53:06

I'm trying to do something here that I think should be possible (?), but the fact that it's not working at all as intended suggests I might be wrong.

With a controlled application of effects, I have created a black-and-white area that defines the shape of a thing I'm ultimately trying to create. If I can apply that shape as a mask to a layer containing a texture, I'd have the completed object, or at least a good base for other actions.

The application help says that I can select the mask of the layer and use paint tools to paint in regions of white and black on the mask to show and hide portions of the masked layer. Well, I already have a layer with the exact black and white pattern I want to apply to the mask, so I should be able to paste it in.

SOUNDS SIMPLE, DOESN'T IT?

Nope, no matter how I try to copy the black-and-white pixel region, no matter how I select the mask, and no matter how I try to paste the intended mask into the layer mask, it immediately pastes in as a new layer instead.

Now, I was able to make this work. I had to export the black-and-white pixel region, select the mask, and replace it with the file I just exported. But this just reinforces my confusion; wasn't that what I was trying to do with cut and paste? There's a way to do this with simple cut and paste, without having to write out temporary files, right?

RIGHT...?
User avatar

2020-12-18 16:04:07

You are totally right that this workflow should be easier. Right now, the method you used (export, then replace the mask) is more or less the correct one. For less experienced users, it's difficult to keep track of which part of a layer – i.e. the layer or the mask – is selected, so we're wary of changing the behavior of such a basic function as copy/paste because it might cause confusion if copy/paste "stops working" when a mask layer is inadvertently selected. But we'll definitely keep this in mind for the future – maybe we could at least make drag and drop work.

Another option you could use is to apply the Image Fill effect to the mask and then drag and drop the mask layer into the image well of that effect. You could then flatten the mask's effects to easily use the painting tools on it.
User avatar

2021-08-31 18:07:40

I've been trying to do this as well. In Photoshop you can alt+click the mask to view the mask. Once you're viewing the mask, you cmd+v to paste in your copied black and white selection.



Glad to learn about Format > Mask > Choose Mask, but a method for pasting into the mask would definitely be preferred.
User avatar

2021-08-31 22:41:23

Copy&paste don´t work for you?
User avatar

2021-09-01 20:47:14

If I copy a black and white layer, select a mask, and paste, it pastes the clipboard contents as a new layer rather than adding it to the mask.
User avatar

2021-09-02 06:41:21

Describing the workflow in Photoshop is not very helpful. Can you list step by step what you want to do. Do you want to copy+paste only the mask or the content or both or what exactly and how is your mask generated? When I draw a selection I can tell:
1. Add mask
2. Copy and paste as Layer
3. Cut and paste as Layer
User avatar

2021-09-02 22:15:00

Hi EllenM,



The workflow I described is not from Photoshop. I was reiterating what Territan and I were trying to do in order to paste a black and white layer as a mask on another layer.



It's not ideal, but the "Choose Mask" feature worked for me. Basically: You have a black and white layer that you'd like to use as the mask on another layer. There's no way to paste the layer into the mask, so you have to export it as a png/jpg and then use the "Choose Mask" feature to add the png/jpg as a mask on another layer.



As Territan mentioned, it would be nice to have a workflow that didn't require creating temporary images outside of Pixelmator.
User avatar

2021-09-03 08:25:13

maybe I´m still not getting it - but
1. You can simply drag a copy of the mask by holding alt-key to a new empty or image layer or another opened .pxd file!
2. copy&paste into new file (paste will contain image+mask) and drag mask onto new image - delete pasted image
3. no need to export anything.
Image
User avatar

2021-09-03 15:05:07

The key here is we're trying to take a layer and use it as a mask.

Here's a screenshot:
Image
User avatar

2021-09-03 15:35:07

That´s even easier to handle.
User avatar

2021-09-03 15:42:39

The first workflow that comes to mind:

1. Choose Edit > Select Color range, select black and click Apply.
2. Hide the "B&W to use as mask" layer.
3. Control-click the "Photo" layer and choose Add Mask.

But I'm sure there are other ways to do it.
User avatar

2021-09-03 16:01:41

Thanks Aurelija. That would provide a similar result, but the "select color range" step will result in a mask that's slightly different than the original black and white layer. In order to retain fine details in the mask, it's necessary to use the original black and white layer exactly as-is.
User avatar

2021-09-03 16:37:09

Seems I don´t get what you´re after, because I can drag a mask layer to new file, new layer, other opened files even copy&paste works as described earlier...
User avatar

2021-09-03 16:50:43

The problem is: Turning a normal layer into a mask. You're talking about moving existing masks.



In my screenshot, both layers are normal layers. Neither is a mask.



Here's the example file if you'd like to check it out:
https://www.dropbox.com/sh/szen81s93jze ... H5JEa?dl=1



Currently it seems the only solution is to export the black and white layer as a png or jpeg and then use the Format > Mask > Choose Mask feature to add the exported png or jpeg as a mask on the selected layer.
User avatar

2021-09-03 17:58:09

What kind of data set is this?

Image
User avatar

2021-09-03 18:09:56

Don't know. I just copied the Dropbox link for the Pixelmator file. For me it downloads a zip which reveals the Pixelmator file when unzipped. Sorry that didn't work for you.



All the file has is two normal layers (no masks). One is black and white and the other is the photo.
User avatar

2021-09-03 18:41:40

Not sure it has something to do with it - I´m on a M1Mac/BigSur and it opens as above. Just downloading without automatic opening show gives a file "photo-mask-example.pxd.zip" and the metadata info tells it´s a SQLite format 3@ no macOS compressed file. Pxd are package files BTW - so renaming to generates a corrupted file that crashes Pixelmator - though it opens.
I can see an image and a second black&white layer. What is your goal now? I mean you can use it with blend modes like "Subtract" for instance.
User avatar

2021-09-03 18:59:45

Unzipping that file should result in the .pxd file. That's the filetype for Pixelmator Pro. If you don't have the Pro version, maybe that's why it's opening as those folders instead of the .pxd file.



Regardless, it's a simple file I quickly threw together as an example. Just two normal layers (no masks), and the goal is to make the exact pixels of the top layer be the mask for the bottom layer.
User avatar

2021-09-06 11:06:19

Does this probably work for you? This is "Load greyscale selection" - add mask - invert mask - invisible greyscale layer:
Image
User avatar

2021-09-07 15:10:38

Yeah, that worked! Tested to make sure it performed identically to the method that requires the temp images, and it does! Thanks for the awesome solution Ellen.
User avatar

2021-09-07 15:39:46

Glad to help. :blush: