JSS Posted December 5, 2024 Posted December 5, 2024 I am not new to Affinity Photo, but I’m trying to up my game. I was trying to figure out how to make a mask from a graduated range of hues. So, I did some experimenting. Here’s what I did and what I found. First, the HSL adjustment combines a hue range selection with three adjustments (H, S, and L). Instead of a selection or mask, you specify a hue range by positing outer and inner pairs of points on the hue circle. This should be equivalent to a mask that is 100% (white) between the inner point pair and then linearly ramps to 0% (black) from inner to outer points on each end. And it is a linear ramp - not an S curve. Second, the live hue range mask does essentially the same thing as the HSL tool hue selection but better, and there are behavior differences. Figure 1 compares the parameter panels for both tools. Notice that I have the selection points set the same way in both. In the HSL panel, S = 0 and L = 100%, so the full adjustment produces white, and the linear ramp goes from nearly 100% read to (nearly) 100% blue, as indicated by the outer ring of the HSL hue circle. Figure 2 shows the experiment and the results. The only difference in these three images is which layers are visible. The HSL and live view mask settings are as in Figure 1. The top displays a red-magenta-blue gradient, which is the test image. Notice the Vectorscope RGB waveform (instead of a histogram) is quite useful here. In the second image, I turned on the live hue range mask. Since it is a mask (and not an adjustment), the black areas of the mask result in transparency. That’s why I needed the pure white background layer. The third image turns off the live mask and turns on the HSL adjustment. The live mask and HSL results are similar but not exact. Check the Vectorscope. The impreciseness in setting the range edge points, especially since the inner endpoints are past red and blue, can explain the mismatch. Now, I was going to show several variations. But this is easy to set up - play around with it. I’m just going to make some observations. (1) The live mask has additional control. In Figure 1, notice the two buttons next to the invert check box. Those open up a curve that governs the gradient from black to white mask (and vice versa). The HSL doesn’t let you control the masking gradient. HSL only provides a linear gradient, which you can verify by comparing the HSL adj. result to the live mask with different gradient curves. (Try a step function curve at different points.) I found this feature to be very useful in a recent project. It provides more flexibility than the hue range selection tool I am familiar with: the Capture One Advanced Color Panel. The C1 tool is a 2D (pie-slice) selection on the hue-saturation disk, but you can only control the softness of the selection. (I've just started playing with stacking live hue range and live luminosity range masks. It seems that would duplicate the C1 tool but with more control.) (2) Of course, the live mask can be applied to a group of adjustments other H, S, and L - like maybe a luminosity curve. In addition, the live mask lets you blur the mask boundary. Does this make sense? Any comments? Quote
NotMyFault Posted December 5, 2024 Posted December 5, 2024 Nice post. Only it is a bit unclear if you want to provide a tutorial. Ressource, or ask a question. There are dedicated sections in the forum for these types of posts. Assuming you are asking: The comparison would be better if you can use identical settings in both variants. A major difference: HSL replaces colors without impacting alpha. Live mask filter creates a mask, working over the alpha channel, so the adjustment layers will use layer blending including alpha blending. Another difference may come from handling of gamma (for RGB document format) When using white background: please always add an dedicated white background layer. There are unfixed bugs giving different results for semitransparent layers over implicit white canvas vs. dedicated layer. Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K iPad Air Gen 5 (2022) A2589 Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
JSS Posted December 5, 2024 Author Posted December 5, 2024 1 hour ago, NotMyFault said: Only it is a bit unclear if you want to provide a tutorial. Well, yes, I did what is an illuminating experiment worth sharing. This forum is the "Feedback & Suggestions" forum - I don't think feedback requires a question. A good discussion may generate some interesting questions. I love Affinity, but the online support is not that great. I scrubbed the Affinity online support user's guide, searched these forums and other internet resources, and found nothing to explain this behavior. That's fine. I imagine that keeping online support up to date is a nightmare for a software company, and it is easier to lean on the knowledge of the crowd. But then we need to have a just plain discussion forum. So, here's my question: If this isn't the right forum, then why doesn't Affinity provide one? And I think I succeeded as you have made some good observations about alpha channels, etc. To clarify, I did not say one is better than the other. My goal was to point out similarities and differences. Like you, I'm a retired engineer, so I like to dive deep into the "technical aspects," which some people find off-putting. Otherwise (like you) "I’m a fine person who respects you and everyone and wants to be respected." 1 hour ago, NotMyFault said: The comparison would be better if you can use identical settings in both variants. OK - how do you do that by positioning a dot on a circle? For example, I can move an object with the transform tool, or punch in position, width, and height in pixels in the transform panel. I am unaware of such a numeric interface for HSL and the live filter. (If not so, it won't be the first time I've missed something right under my nose. 🙂 ). Is one needed - probably not, IMHO. Quote
JSS Posted December 7, 2024 Author Posted December 7, 2024 More Experiments! I was motivated to dig into the live masks because I thought it would be a great way to apply an adjustable (live) mask to a group of adjustments. The live hue mask is determined by other layers - which begs the question - exactly which layers? Rather than posting a sequence of screenshots, I put my experiments in the attached afphoto file. There are four experiments labeled A-D. When you open it, the text gradient is the bottom layer, and the experiments are the collapsed groups. Initially, no experiments are active. Make sure you only activate one experiment group at a time. Experiments A and B are reproductions of my initial post, except I'm using fade-to-black (instead of white). A is the HSL adjustment, and B is a black fill layer with a live hue range mask. I've tweaked things A and B to produce identical results. (Use the scope with RGB Waveform mode.) Now, what happens when you live mask an adjustment group? Is the mask determined affected by child layer adjustments? You wouldn't want the live hue mask affected by color adjustments in the group's child layers. But that is what happens. If you expand B, you will see the live mask is the mask layer, and there is an inactive child layer. Check out what happens when you activate the child layer. Option-click on the live mask to see the impact on the mask. Experiments C and D play with masking groups. Both have live hue range masks that are copies of the B-mask, and both have an exposure adjustment set to black as a child layer. In C, the live mask is a mask layer (above the thick line). You will see that group C has no effect regardless of whether or not the exposure adjustment is active. Option-click on the live mask to find that the masking behavior is completely different when the child exposure layer is active. D is the same, except the live mask is moved to the bottom child layer of the group. Now, the group behaves as expected, duplicating A and B results. Conclusion: An ordinary mask is applied above the line to all child layers regardless of z-order. A live mask above the line is likewise applied to all child layers (like ordinary masks) but is also affected by all child layers. I don't think that is what we want. It is not about how the mask is applied but how it is determined. In a group, an above-the-line live mask should be determined by layers below the group and not in the group. That seems to me to be the natural, expected behavior. A group of adjustments should behave like a single adjustment layer, but if you drop a live mask layer on it, the mask changes. The live mask does not change when you drop it on the fill layer in experiment B. Food for Affinity thought? Test_1.afphoto Quote
NotMyFault Posted December 7, 2024 Posted December 7, 2024 2 hours ago, JSS said: I don't think that is what we want. That is possible, but the behavior of masks is as documented in affinity.help. Affinity lacks a concept to create content (including any layer types or masks) as result of e.g. layer blending or composition of masks at one place and using this at another place (maybe multiple times at different places). The current concept of linked layers, symbols or placed files is too limited. Often you need to fall back to merged layers or spare channels and cannot stay pure non-destructive. Similarly, Affinity lacks live conversion between color spaces, color profiles, RGB to HSL or HSV etc. those functions are only available destructively or deeply buried inside e.g HSL adjustments. Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K iPad Air Gen 5 (2022) A2589 Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
NotMyFault Posted December 7, 2024 Posted December 7, 2024 If you want to create a live mask, the mask is always directly created from and immediately applied to the same underlying layers or image. Affinity can separate these functions currently (for nondestructive workflows). I tried to use tricks like linked layers or symbols to decouple both, but you will run into complications very soon. This leads to nowhere. Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K iPad Air Gen 5 (2022) A2589 Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
JSS Posted December 8, 2024 Author Posted December 8, 2024 16 hours ago, NotMyFault said: 19 hours ago, JSS said: I don't think that is what we want. That is possible, but the behavior of masks is as documented in affinity.help. In my first response to you, I wrote, "I scrubbed the Affinity online support user's guide, searched these forums and other internet resources, and found nothing to explain this behavior." Of course, that included searching the user's manual on affinity.help. I spent hours researching and experimenting to tease out this behavior. I even rewatched the Affinity video Clipping vs. Masking several times. Please show me where there is a statement about live mask behavior as a group mask. Please show me where it says the live mask can be determined by the very adjustments that it is masking. Affinity Help for Live Masks only says, "Compare this to traditional masks .. are inherently tied to an image's subject matter." There is no statement of exactly what subject matter. Do you think it is obvious a group live mask is "tied" to the various layers it is masking? I don't, and I don't appreciate being brushed off by being told to read the user manual - which I did. mask determined by layers below => mask is applied to child adjustment layers => mask redetermined by adjusted layers below This is a feedback loop. As my experiments showed, it can cause some rather unexpected and difficult-to-debug effects. A feedback loop between live layers is NOT a good idea! That's my opinion, and it is quite justifiable. There are two solutions, which I will post to Affinity. Leave the behavior as is, but in the live mask documentation, point out the feedback loop created by a child adjustment layer when a live mask is used as a group mask, and offer the workaround I suggested (move the live mask to the bottom of the child layers). At very least, there should be a warning about applying a live mask to an entire group. (preferred) For the case of a live mask applied as a group mask, determine the mask from only the layers below the group - not the child layers of the group being masked. Explain this is done to break the feedback loop. Quote
NotMyFault Posted December 8, 2024 Posted December 8, 2024 4 hours ago, JSS said: Please show me where there is a statement about live mask behavior as a group mask. I refer to this single statement from help: Live layer masks Live layer mask are non-destructive masks, based on hue, luminosity and frequency, that update automatically based on the properties of the underlying image In my interpretation it states that the mask depends on the content of the underlying image. Using the test file you provided earlier all 4 test cases behave correspondingly to that statement. Groups were not specifically mentioned in help, never the less the mask behaves in relation to any content below the group or child nested to the group according to how it behaves to any other masks (non live masks). Specifically if you use luminosity masks: except for well known unfixed bugs, luminosity masks act analogous to blend ranges (in blend options). Example of well known bug: - blend ranges for groups stop working when another mask is added. - adjustments alpha channel on groups and pixel layers don’t work with blend mode path-through 4 hours ago, JSS said: Do you think it is obvious a group live mask is "tied" to the various layers it is masking? I don't, and I don't appreciate being brushed off by being told to read the user manual - which I did. I did not intend to brush you off. your posts are quite lengthy to read, containing multiple statements and questions about behavior and documentation. I may have forgotten some details of your first post when answering to later posts, so no offense from my side. Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K iPad Air Gen 5 (2022) A2589 Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
NotMyFault Posted December 8, 2024 Posted December 8, 2024 On 12/5/2024 at 3:08 PM, JSS said: Like you, I'm a retired engineer, I‘m not yet retired Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K iPad Air Gen 5 (2022) A2589 Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
NotMyFault Posted December 8, 2024 Posted December 8, 2024 The effects of live masks you are observing are not caused by live masks. You can observe the same behavior when you would replace the live mask by another method like blend ranges or live filters and adjustments who can impact the alpha channel like procedural textures filter or channel mixer adjustments. So the artifacts you observe are just symptoms of how Affinity apps blend layers and groups, and not specific to live masks. Quote Mac mini M1 A2348 | MBP M3 Windows 11 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 | Dell 27“ 4K iPad Air Gen 5 (2022) A2589 Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps. I use iPad screenshots and videos even in the Desktop section of the forum when I expect no relevant difference.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.