Copy Adjustment Layer Masks?

Corel Paint Shop Pro

Moderator: Kathy_9

Post Reply
migf1
Posts: 412
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Copy Adjustment Layer Masks?

Post by migf1 »

Is it possible to copy the mask of an adjustment layer to another adjustment layer, or to any layer?
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
LeviFiction
Advisor
Posts: 5916
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Copy Adjustment Layer Masks?

Post by LeviFiction »

Yes, in a roundabout way.

Select the adjustment layer you want to copy the mask from. Hit Select All ( Ctrl + A) then float the selection Ctrl + F. Move the floated selection above the mask layer and defloat it (Ctrl + Shift + F). If you want it to be a regular layer just promote the selection.
migf1
Posts: 412
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Copy Adjustment Layer Masks?

Post by migf1 »

Works like a charm, thanks Levi!
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
migf1
Posts: 412
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Copy Adjustment Layer Masks?

Post by migf1 »

Just watched a new video about makeup, doing everything with masks and adjustment layers (this one: https://youtu.be/9Gw70Qo_wnQ). Almost nothing new to me to be honest, except copying adjustment masks across different images. For same image they do what Levi suggested, which works a charm but not across different images (or I hadn't found how).

In the description of that video they also list the following steps for copying adjustment masks across different images:
Source & Destinations Layers In Different Images:
1. (Source Layer) Selections | Select All (Ctrl+A)
2. (Source Layer) Selections | Float (Ctrl+F)
3. (Source Layer) Edit | Copy (Ctrl+C)
4. (Source Layer) Selections | Select None (Ctrl+D)
5. (Destination Layer) Selections | Select All (Ctrl+A)
6. (Destination Layer) Edit | Paste Into Selection (Ctrl+Shift+L)
7. (Destination Layer) Selections | Select None (Ctrl+D)
Before I start recording a script, is there a faster way of doing that?
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
LeviFiction
Advisor
Posts: 5916
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Copy Adjustment Layer Masks?

Post by LeviFiction »

That is the fastest recorded scripting method. Yes.

This is the beginning of a script that might work as well. It's quite simple and basic but I think it will work. This one script handles both copying and pasting. Select an adjustment Layer and run the script it'll copy the entire layer to the clipboard and save the layer location to the ScriptData dictionary. Select another layer that can be pasted into, run the script again, it'll create a custom selection based on the layer location Rect and paste the the layer data into the selection. If you paste a mask from a large image into a smaller image, it will scale the mask. If you paste from a smaller image into a larger image the mask will remain the same size and at the same location. This same method can be used to simplify paste in place.

It won't work between copies of PSP, and the Rectangle data will be lost if you close PSP.
Attachments
CopyPasteAdjustmentLayer.zip
(710 Bytes) Downloaded 7 times
migf1
Posts: 412
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Copy Adjustment Layer Masks?

Post by migf1 »

Thanks again Levi!

I just downloaded the script, but I'll really test it tomorrow, and come back with feedback.
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
migf1
Posts: 412
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Copy Adjustment Layer Masks?

Post by migf1 »

Just tried the script Levi, and it works beautifully for adjustment layers (thanks again!). However, it doesn't seem to work with regular mask layers.

I recorded 3 scripts for my purposes (requiring same dimensions images) that seem to work both for regular mask-layers and adjustment-layers, and I've put them along-side yours in one of my custom menus.

I'm attaching them below, in case they are useful to other people too:
migf1-copy-mask-in-place.zip
(2.7 KiB) Downloaded 6 times
Copy Mask Contents (source image)
Use this with a mask-layer or an adjustment-layer selected, to copy the mask contents to the clipboard.

Paste Mask Contents In Place (destination image)
Use this with a mask-layer or an adjustment-layer selected, to replace its mask contents with the clipboard data. This works ONLY when the data have been copied to the clipboard via the "Copy Mask" script described above.

New Mask In Place (destination image)
Use this with a base raster/vector/group layer selected, to mask it according to the clipboard data. This works ONLY when the data have been copied to the clipboard via the "Copy Mask" script described above, and the base layer CANNOT be an adjustment layer.
PS. I'm not sure what you mean about the Paste In Place. I mean I get you suggest the same method can be used for a Paste In Place script, but are you going to give it a try after all? :mrgreen:
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
LeviFiction
Advisor
Posts: 5916
Joined: Thu Oct 02, 2008 1:07 pm
operating_system: Windows 10
System_Drive: C
32bit or 64bit: 64 Bit
motherboard: Alienware M17xR4
processor: Intel Core i7-3630QM CPU - 2_40GH
ram: 6 GB
Video Card: NVIDIA GeForce GTX 660M
sound_card: Sound Blaster Recon3Di
Hard_Drive_Capacity: 500GB
Corel programs: PSP: 8, 9, X, XI, X2, X8,X9, 2018, 2019
Location: USA

Re: Copy Adjustment Layer Masks?

Post by LeviFiction »

Of course it doesn't work with Regular masks you asked about adjustment layers and like I said it's only the beginning of a script. It does one thing and one thing only. Copying and pasting adjustment layer masks.

It can copy from an adjustment layer to a regular mask layer, just not the other way around. If you go into the script and remove ", App.Constants.LayerType.Mask" from the list of layer types to ignore it will copy regular masks too.

However, my script doesn't work. As it only copies and pastes the area that PSP identifies as the masked area. If the mask/adjustment layer you're copying to already has something on it, it's not guaranteed to replace all of it. Meaning that the select all/float option gives you the best solution. There is also an issue with mine if you invert the mask. It will fill in the area properly but won't take in to account the mask inversion.

And no I won't be making a paste in place script, but if someone did want to my script shows how to grab the location and save it using JascUtils' ScriptData dictionary so it can be used between runs of scripts. Allowing the script programmer to paste and then move the layer back into position.
migf1
Posts: 412
Joined: Fri Apr 03, 2020 3:09 pm
operating_system: Windows 8.1
System_Drive: C
32bit or 64bit: 64 Bit

Re: Copy Adjustment Layer Masks?

Post by migf1 »

Ah, I see. Thanks for explaining it Levi!

EDIT: Btw, in my tests your script worked fine Levi.
Good Unofficial PaintShop Pro Tutorials: Creation CasselMake Shop ProHEC Image EditingLeviFiction PSP Basics
(plus my own Gimp & Stuff)
Post Reply