Maybe there's another way to do this, but....
While creating a mask, it would be nice to be able to define a keep-out or keep-in area that a tool, such as flood fill, would be restricted to work within. For example, when using 'color range,' I might want to apply a certain setting to only one portion of the image.
This keep-out / keep-in idea may be applicable to transforms other than masking.
Thoughts or suggestions?
Thanks!
John P
Mask creation feature request
Moderator: jsachs
Re: Mask creation feature request
Setting aside flood fill which has some other issues, you should be able to accomplish this using the Overlap mask mode. For example, to restrict a mask to a certain area of the input image, first create a mask for this region, perhaps using the freehand outline tool. Next, switch the mode to Overlap and then apply your next mask tool. In Overlap mode, only pixels that are in both masks make it to the result mask, i.e. the area where the two masks overlap.
The overlap feature works, even with masks that are less than 100% -- I don't have time to test this now but I assume flood fill will create a mask that goes potentially to the entire image but in overlap mode this mask is clipped to the previous mask. This is not quite the same as preventing flood fill from exploring areas outside the previous mask, but it is not clear how this would work if the mask was less than 100%.
The overlap feature works, even with masks that are less than 100% -- I don't have time to test this now but I assume flood fill will create a mask that goes potentially to the entire image but in overlap mode this mask is clipped to the previous mask. This is not quite the same as preventing flood fill from exploring areas outside the previous mask, but it is not clear how this would work if the mask was less than 100%.
Jonathan Sachs
Digital Light & Color
Digital Light & Color
-
- Posts: 123
- Joined: December 10th, 2009, 11:52 pm
- What is the make/model of your primary camera?: Canon 90D
Re: Mask creation feature request
I'm don't think the overlap will work for my use case.
Assume I have do a serious of mask creation operations already. To use overlap, I need to change what I already have by drawing the keep-out area into the current mask - this would destroy work I have already done in the 'keep-in' area that I want to tweak.
John P
Assume I have do a serious of mask creation operations already. To use overlap, I need to change what I already have by drawing the keep-out area into the current mask - this would destroy work I have already done in the 'keep-in' area that I want to tweak.
John P
Re: Mask creation feature request
Maybe I am not understanding your suggestion. Overlap does not destroy any previous operations -- you can either start with the keep in/out mask and add other operations in overlap mode or you can do the operations first and then add the keep in/out mask in overlap mode.
Jonathan Sachs
Digital Light & Color
Digital Light & Color
-
- Posts: 123
- Joined: December 10th, 2009, 11:52 pm
- What is the make/model of your primary camera?: Canon 90D
Re: Mask creation feature request
Maybe I don't understand the overlap operation. From the doc, I see:
"Clears the parts of the current mask that do not overlap the new mask. Use this mode when you want to create a mask based on two conditions being met simultaneously, for example, to create a mask consisting of all pixels in a certain region with colors in a certain range."
I don't want to clear areas, I want to protect areas. Here's an example of the flow...
1) Open the Masks transform and start a new mask.
2) Do a transform to select a certain range of colors. This potentially affects the entire new mask since it looks at the whole input image.
3) Tweak the mask with more operations, such as spline, freehand, or anything else.
4) do some more operations
5) now I want to do something like a flood fill or a 'color range', but I want to restrict it to a certain area. I don't want it to have global impact.
As an example of what I'm doing, I have a picture of a Queens Ann's Lace flower that I want to have a pure black background. To create a mask to separate flower from background requires a bunch of steps to make the mask. Since a lot of the internal colors of the flower can be fairly similar to other parts of the image, trying to use 'color range' will impact the entire mask. It would be nice to have a keep out type are to restrict the operation to a local are, ie, the inside of the flower. It looks to me like the 'overlap' option clears areas of the mask whereas I want to preserve them.
Am I missing something in the way overlap works?
Thanks!
John P
"Clears the parts of the current mask that do not overlap the new mask. Use this mode when you want to create a mask based on two conditions being met simultaneously, for example, to create a mask consisting of all pixels in a certain region with colors in a certain range."
I don't want to clear areas, I want to protect areas. Here's an example of the flow...
1) Open the Masks transform and start a new mask.
2) Do a transform to select a certain range of colors. This potentially affects the entire new mask since it looks at the whole input image.
3) Tweak the mask with more operations, such as spline, freehand, or anything else.
4) do some more operations
5) now I want to do something like a flood fill or a 'color range', but I want to restrict it to a certain area. I don't want it to have global impact.
As an example of what I'm doing, I have a picture of a Queens Ann's Lace flower that I want to have a pure black background. To create a mask to separate flower from background requires a bunch of steps to make the mask. Since a lot of the internal colors of the flower can be fairly similar to other parts of the image, trying to use 'color range' will impact the entire mask. It would be nice to have a keep out type are to restrict the operation to a local are, ie, the inside of the flower. It looks to me like the 'overlap' option clears areas of the mask whereas I want to preserve them.
Am I missing something in the way overlap works?
Thanks!
John P
-
- Posts: 1484
- Joined: April 25th, 2009, 12:56 am
- What is the make/model of your primary camera?: Fuji X-E2
- Contact:
Re: Mask creation feature request
Do I understand it correctly: you already made a mask covering the flower? That's the white area of the mask? It probably has complex boundary, but does it also have 'holes' or is it a solid area?but I want to restrict it to a certain area
Then, with this mask already existing, you would like to add to it using Mask's colour range tool? But at the edges or inside the flower (if the mask got holes)? The areas outside flower mask's outer edges are to be excluded from the latter mask addition?
A screenshot may be helpful. Attaching it's easy, but sometimes you need to down sample it and compress the JPG more due to size restrictions.
Maciej Tomczak
Phototramp.com
Phototramp.com
-
- Posts: 1484
- Joined: April 25th, 2009, 12:56 am
- What is the make/model of your primary camera?: Fuji X-E2
- Contact:
Re: Mask creation feature request
Do I understand it correctly: you already made a mask covering the flower? That's the white area of the mask? It probably has complex boundary, but does it also have 'holes' or is it a solid area?but I want to restrict it to a certain area
Then, with this mask already existing, you would like to add to it using Mask's colour range tool? But at the edges or inside the flower (if the mask got holes)? The areas outside flower mask's outer edges are to be excluded from the latter mask addition?
A screenshot may be helpful. Attaching it's easy, but sometimes you need to down sample it and compress the JPG more due to size restrictions.
Maciej Tomczak
Phototramp.com
Phototramp.com
Re: Mask creation feature request
I am still on vacation in the Azores -- will respond in a few days.
Jonathan Sachs
Digital Light & Color
Digital Light & Color
Re: Mask creation feature request
Overlap can either preserve and area or clear an area depending on what you overlap with. For example to limit an existing mask to a subregion, overlap with a mask covering that region. To clear the subregion, overlap with a mask that covers everything but the subregion. This method works for a single mask operation, but may not be sufficient when creating a complicated mask.
If I understand what you are trying to do, you first perform a series of mask operations and then want to add a flood fill or color range operation, but you want to limit the effects of this additional operation to a subregion of the image, but do not want to affect the existing mask outside of that subregion.
I can think of two ways to do this using the existing mask tools:
1) Using the Save Current Mask and Combine Saved Mask
a) Perform you initial mask operations and then use the mask setting menu to Save Current Mask. This saves a temporary copy of the current mask.
b) Clear the mask (set entire mask to black).
c) Do the flood fill or color range
d) Change the mode to Overlap
e) Use the freehand outline or some other tool to define the area you want to limit the flood fill or overlap to
f) Set the mode to Add
g) Use the settings menu to Combine Saved Mask -- this will restore the save mask and combine it by adding it to the restricted flood fill or color range mask.
2) Using the Masks transformation
a) Start up Masks and build Mask 1 by performing your initial operations as above
b) Build Mask 2 by performing the flood fill or color range operation - then switch to Overlap mode and cut out the parts you don't want.
c) Set Output to Mask 1 + Mask 2 -- the output image will be a combination of the two masks.
Both of these methods are somewhat awkward so I can see how what you are suggesting would simplify the process, however I don't see an easy way to implement this new feature without unduly complicating what is already a complicated part of PWP. One feature I could see adding fairly easily would be the ability to optionally limit flood fill or color range to just the parts of the image that are already masked or to the parts that are unmasked, but I don't think this would work in the case you are asking about.
If I understand what you are trying to do, you first perform a series of mask operations and then want to add a flood fill or color range operation, but you want to limit the effects of this additional operation to a subregion of the image, but do not want to affect the existing mask outside of that subregion.
I can think of two ways to do this using the existing mask tools:
1) Using the Save Current Mask and Combine Saved Mask
a) Perform you initial mask operations and then use the mask setting menu to Save Current Mask. This saves a temporary copy of the current mask.
b) Clear the mask (set entire mask to black).
c) Do the flood fill or color range
d) Change the mode to Overlap
e) Use the freehand outline or some other tool to define the area you want to limit the flood fill or overlap to
f) Set the mode to Add
g) Use the settings menu to Combine Saved Mask -- this will restore the save mask and combine it by adding it to the restricted flood fill or color range mask.
2) Using the Masks transformation
a) Start up Masks and build Mask 1 by performing your initial operations as above
b) Build Mask 2 by performing the flood fill or color range operation - then switch to Overlap mode and cut out the parts you don't want.
c) Set Output to Mask 1 + Mask 2 -- the output image will be a combination of the two masks.
Both of these methods are somewhat awkward so I can see how what you are suggesting would simplify the process, however I don't see an easy way to implement this new feature without unduly complicating what is already a complicated part of PWP. One feature I could see adding fairly easily would be the ability to optionally limit flood fill or color range to just the parts of the image that are already masked or to the parts that are unmasked, but I don't think this would work in the case you are asking about.
Jonathan Sachs
Digital Light & Color
Digital Light & Color