Page 1 of 1
Combining Masks
Posted: February 28th, 2025, 9:54 pm
by Robert Schleif
I am having difficulty combining two masks. The Mask transformation dialog box allows the operation Mask 1 + Mask 2, and this produces an image of the combination in the right hand image area. I have been unable to find a way to use this combination as a mask however. Alas, the documentation doesn't help me as things don't seem to work as described and what is described seems unnecessarily round about.
It would be so nice If the Mask 1 + Mask 2 operation produced a new mask, naming if Mask 3 or 4 (or Mask 1 in a new Mask transformation box if Masks 1, 2, 3, and 4 have already been made in the first Mask transformation).
Re: Combining Masks
Posted: February 28th, 2025, 11:41 pm
by jsachs
If you are using Masks to combine masks, you can only combine 2 masks and the result becomes the output image. You can then select this output image for use as a mask in some other transformation. Usually, if you are doing this you will want to use a splitter and put the Masks transformation on a separate branch.
If I understand it correctly, there is no easy way to implement your proposal.
Re: Combining Masks
Posted: March 1st, 2025, 8:55 am
by Robert Schleif
Thank you for your response.
Part of my difficulty seems to be that saving a mask doesn't seem to work. If I have created two masks, reopen the first for editing, and then select "Save current mask", then open the transformation in which the second mask was created, I get the message "No saved mask image".
Re: Combining Masks
Posted: March 1st, 2025, 9:04 am
by jsachs
OK, that is a different scenario. I am on vacation for another day or two. Can you write up a slightly more detailed description of the problem and I will fix it when I get return.
Re: Combining Masks
Posted: March 1st, 2025, 4:12 pm
by Robert Schleif
After some playing around, I have learned one way of combining two masks.
What I did not appreciate is that the two masks to be combined using the output of the Mask transformation must be mask 1 and mask 2 in that Masks transformation.
I also did not appreciate the fact that the B&W image produced by the output of Masks which occupies a position normally occupied by an image being edited may also be used as a mask and will show up in the list of eligible masks in other transformations. (I do not know whether any old 8 bit image with the right dimensions will also show up in such lists and work as a mask. I suspect so.)
Finally, I expected there might be a requirement that in order that a transformation be able to use a combined mask, that transformation must be below the combined mask "image", even if it is in a different branch. This does not appear to be so. It appears that a combined mask generated in one branch of an image tree can be used at any level below the generating splitter in other branches of the tree.
Now I do not know what the ability to save a mask internally and the two commands in the Masks dialog box, "Save current mask" and "Combine saved mask" are for. (Combining two masks not made in the same Masks transformation?) At any rate, I seem not to have found the right context for "Save current mask" to do anything.
Truely finally: particularly when building masks in small pieces using the flood fill tool, I would find it to be helpful if there were key shortcut for clicking on the Action button.
Well, maybe this will be my final point. I seems like it could be helpful if the PWP documentation could be digested by an LLM and its wisdom (if one is on the web) could be tapped from within PWP and queries such as "How do you build a mask for an object with highly irregular edges?" would yield good answers.
Re: Combining Masks
Posted: March 1st, 2025, 8:43 pm
by tomczak
Re: Combining Masks
Posted: March 3rd, 2025, 5:03 pm
by Robert Schleif
It would be nice if the software could be engineered so that the process were straightworward and the necessary menu necessary choices were obvious.
Re: Combining Masks
Posted: March 3rd, 2025, 6:32 pm
by jsachs
>> What I did not appreciate is that the two masks to be combined using the output of the Mask transformation must be mask 1 and mask 2 in that Masks transformation.
This follows from the Output options for combining masks only referencing Mask 1 and Mask 2
>> I also did not appreciate the fact that the B&W image produced by the output of Masks which occupies a position normally occupied by an image being edited may also be used as a mask and will show up in the list of eligible masks in other transformations. (I do not know whether any old 8 bit image with the right dimensions will also show up in such lists and work as a mask. I suspect so.)
Any 8- or 16-bit B&W image of the same size as the input image that does not depend on the current transformation can be used as a mask and will show up in the menu.
>> Finally, I expected there might be a requirement that in order that a transformation be able to use a combined mask, that transformation must be below the combined mask "image", even if it is in a different branch. This does not appear to be so. It appears that a combined mask generated in one branch of an image tree can be used at any level below the generating splitter in other branches of the tree.
Above and below do not matter -- upstream and downstream are what counts.
>> Now I do not know what the ability to save a mask internally and the two commands in the Masks dialog box, "Save current mask" and "Combine saved mask" are for. (Combining two masks not made in the same Masks transformation?) At any rate, I seem not to have found the right context for "Save current mask" to do anything.
This feature is a little like some calculators that have a temporary storage location you can copy numbers to and then use later in the calculation. You can use it as follows:
1) perform a series of mask operations that produce a mask you want to combine with the result of several other mask operations.
2) save the mask (Save current mask)
3) clear the mask (Set to black) or continue to edit the current mask, applying some other mask operations to it.
4) set the mask combine mode (add/subtract/overlap/invert) to the way you want to combine the current mask with the saved mask
5) combine the saved mask with the current mask (Combine saved mask)
For example, consider two masks -- Mask A is a blurred rectangle while Mask B is a blurred circle. You can create a mask that is a combination of these two masks as follows:
1) create the rectangle mask and then blur it
2) save the mask
3) clear the mask
4) create the circle mask and then blur it
5) set the combine mode - e.g. to subtract mode
6) combine the saved mask with the current mask
7) the results in Mask B minus Mask A
This method lets you build the mask without resorting to the Masks transformation. Using Masks, the equivalent is to create Mask B as Mask 1 and Mask A as Mask 2 and then set Output to Mask1 - Mask 2. This is easier to understand but clumsy to use since you then need to use a splitter if you need to continue using the input image in subsequent transformations.
>> Truly finally: particularly when building masks in small pieces using the flood fill tool, I would find it to be helpful if there were key shortcut for clicking on the Action button.
Ctrl-Shift Click adds a new control point and finalizes the mask operation. It used to be Shift-Click but when I added the new feature to define the seed color as a line as well as a point I needed Shift-Click to define the endpoint of the line.
Re: Combining Masks
Posted: March 11th, 2025, 7:45 pm
by Robert Schleif
Thank you for the additional information.
Re: Combining Masks
Posted: March 11th, 2025, 11:36 pm
by tomczak
The STO and RCL (or MS and MR) calculator memory buttons metaphor helps to remember how it works.