telemax Posted March 6, 2021 Share Posted March 6, 2021 This is a completely non-destructive mask, which is a group of many layers. You can use many raster and vector layers/objects in one mask. And of course, you can edit them!Nondestructive_Mask.afphoto Nondestructive_Mask_Test.afphoto Nondestructive_Mask.afassets How to use Place your mask parts between the Procedural Texture and the Fill Layer. If necessary, change the background transparency, changing the Fill Layer color. To apply this mask-group only to a specific layer, nest it. To apply a mask-group to multiple layers, select mask-group and desired layers below, and group them. Then change blending mode for this new group, from Passthrough to Normal. How it works This is a group with the "Erase" blending mode. This group has two main layers, the Procedural Texture and the Fill Layer. The Procedural Texture turns rgb and grey pixels into alpha. Formula: 1-rgbtoi(R,G,B)-a=Alpha Many thanks to @NotMyFault Fill layer is required to control the background transparency. In conclusion This non-destructive composite mask allows you to fine-tune individual parts of the mask, achieving the desired result. Affinity interactivity allows you to see the result of your operations in real time, unlike some other programs. Opportunities Nondestructive editing and moving Multiple individual mask parts Vector and raster Color and greyscale Applying adjustments Created using a mask consisting of many parts Wosven, NotMyFault, Frozen Death Knight and 4 others 7 Quote Non-destructive Mask https://forum.affinity.serif.com/index.php?/topic/150439-non-destructive-mask/Image layer & Pixel layer https://forum.affinity.serif.com/index.php?/topic/146720-image-layer-and-pixel-layer/Brushes | Stars https://forum.affinity.serif.com/index.php?/topic/135202-brushes-stars/ Link to comment Share on other sites More sharing options...
NotMyFault Posted March 6, 2021 Share Posted March 6, 2021 Nice, the erase blend mode was the missing piece in my tries telemax 1 Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 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. Link to comment Share on other sites More sharing options...
NotMyFault Posted March 6, 2021 Share Posted March 6, 2021 Here a even nicer filter: replaced manual RGB by rgbtoi added "-a" The input variable "a" allows you to gradually fade the mask effect, to reveal hidded areas. This is really usefull to edit masks at the edges, beeing able to see both the background and the actual mask in realtime. telemax, Max P and JoseLuis 1 2 Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 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. Link to comment Share on other sites More sharing options...
telemax Posted March 6, 2021 Author Share Posted March 6, 2021 1-rgbtoi(R,G,B) fully matches the quality of a regular mask. While 1-(R+G+B)/3 which gives a small color banding on the gradients. Files reuploaded. NotMyFault 1 Quote Non-destructive Mask https://forum.affinity.serif.com/index.php?/topic/150439-non-destructive-mask/Image layer & Pixel layer https://forum.affinity.serif.com/index.php?/topic/146720-image-layer-and-pixel-layer/Brushes | Stars https://forum.affinity.serif.com/index.php?/topic/135202-brushes-stars/ Link to comment Share on other sites More sharing options...
Max P Posted March 6, 2021 Share Posted March 6, 2021 Wow! Without you, I would never have understood, limited to my understanding. Thank to you telemax and NotMyFault Without error, the formula 1- (0.2126 * R + 0.7152 * G + 0.0722 * B) -a gives the same result in 16 bit or 32 bit, knowing that for a strict mask 8 bit is sufficient, can you confirm me please Quote Link to comment Share on other sites More sharing options...
NotMyFault Posted March 6, 2021 Share Posted March 6, 2021 Hi Max, that really depends on your needs and definition of "strict mask". hard edges for a sharp cut-out: 1 bit is enough featherd edges of objects to smoothen transition to background: normally only 1-5 pixels wide, so you wouldn't neet more then 4-16 alpha values, 5 bit would be ok CGI, 3D renders, smooth transitions between layers filled with saturated primary color gradients, sky or monochromatic areas? You need the maximum possible! In Affinity (and as far as i know in all file formats), alpha channel is always limited to 8 bits, or 256 different values. So yes, 8 bit is sufficient (or even overkill) in all cases listed above. The only situation where you might need more bits is when you use the alpha channel for other purposes than masking, e.g. game developers use alpha for z-axis (3D depth channel). To give an accurate answer your question, we first need to know your specific use case (defintion of "strong mask"). But i assume it will be ok Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 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. Link to comment Share on other sites More sharing options...
Max P Posted March 6, 2021 Share Posted March 6, 2021 Hi NotMyFault Thank take time for answer to me I' m not a professionnal I'm just a retiree who has time to explore some solutions, in fact my interest is more, the ability to mix transparent images, shots of images included in vector shapes in a plane, an image wider, possibly with a z depth. ( Affinity, Open GL?, blender?). In fact I use less and less mask but more and more layers in Erase mode, with paintbrush with modultation opacity Well I'm not going to waste you more time thank you again NotMyFault and dmstraker 2 Quote Link to comment Share on other sites More sharing options...
NotMyFault Posted March 6, 2021 Share Posted March 6, 2021 Hi Max and telemax, it is a great pleasure to share some challenges & tricks with you. Have a nice weekend, Timo telemax and Max P 2 Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 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. Link to comment Share on other sites More sharing options...
dmstraker Posted March 7, 2021 Share Posted March 7, 2021 Pardon a tad ignorance. What does rgbtoi do, exactly. Presumably takes R, G and B and converts to single integer? What's the algorithm, please. Thanks Quote Dave Straker Cameras: Sony A7R2, RX100V Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11" Favourite word: Aha. For me and for others. Link to comment Share on other sites More sharing options...
Max P Posted March 8, 2021 Share Posted March 8, 2021 Hi dmstraker Take a color in Hex, and extract componant in decimal, [0....255] if i remenber well Hex: #fed33c rgb(254,211,60) The help say rgbtoi use rgbtoi(S r, S g, Sb) or rgbtoi(V rgb) dmstraker 1 Quote Link to comment Share on other sites More sharing options...
dmstraker Posted March 9, 2021 Share Posted March 9, 2021 On 3/8/2021 at 8:24 AM, Max P said: Hi dmstraker Take a color in Hex, and extract componant in decimal, [0....255] if i remenber well Hex: #fed33c rgb(254,211,60) The help say rgbtoi use rgbtoi(S r, S g, Sb) or rgbtoi(V rgb) Thanks, @Max P. It's nice to have lots of functions though it would be nicer if the help system told us a bit more about what they do. Max P 1 Quote Dave Straker Cameras: Sony A7R2, RX100V Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11" Favourite word: Aha. For me and for others. Link to comment Share on other sites More sharing options...
NotMyFault Posted March 9, 2021 Share Posted March 9, 2021 On 3/7/2021 at 9:44 PM, dmstraker said: Pardon a tad ignorance. What does rgbtoi do, exactly. Presumably takes R, G and B and converts to single integer? What's the algorithm, please. Thanks Hi, it uses the conversion factors defined in ITU-R 601 https://en.wikipedia.org/wiki/Grayscale Luma coding in video systems Main article: luma (video) For images in color spaces such as Y'UV and its relatives, which are used in standard color TV and video systems such as PAL, SECAM, and NTSC, a nonlinear luma component (Y') is calculated directly from gamma-compressed primary intensities as a weighted sum, which, although not a perfect representation of the colorimetric luminance, can be calculated more quickly without the gamma expansion and compression used in photometric/colorimetric calculations. In the Y'UV and Y'IQ models used by PAL and NTSC, the rec601 luma (Y') component is computed as Y′=0.299R′+0.587G′+0.114B′{\displaystyle Y'=0.299R'+0.587G'+0.114B'} where we use the prime to distinguish these nonlinear values from the sRGB nonlinear values (discussed above) which use a somewhat different gamma compression formula, and from the linear RGB components Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 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. Link to comment Share on other sites More sharing options...
dmstraker Posted March 9, 2021 Share Posted March 9, 2021 Just now, NotMyFault said: it uses the conversion factors defined in ITU-R 601 https://en.wikipedia.org/wiki/Grayscale Luma coding in video systems Main article: luma (video) For images in color spaces such as Y'UV and its relatives, which are used in standard color TV and video systems such as PAL, SECAM, and NTSC, a nonlinear luma component (Y') is calculated directly from gamma-compressed primary intensities as a weighted sum, which, although not a perfect representation of the colorimetric luminance, can be calculated more quickly without the gamma expansion and compression used in photometric/colorimetric calculations. In the Y'UV and Y'IQ models used by PAL and NTSC, the rec601 luma (Y') component is computed as Y′=0.299R′+0.587G′+0.114B′{\displaystyle Y'=0.299R'+0.587G'+0.114B'} where we use the prime to distinguish these nonlinear values from the sRGB nonlinear values (discussed above) which use a somewhat different gamma compression formula, and from the linear RGB components Many thanks @NotMyFault! Do you know of any source where I can find more about other hardly-documented functions? NotMyFault 1 Quote Dave Straker Cameras: Sony A7R2, RX100V Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11" Favourite word: Aha. For me and for others. Link to comment Share on other sites More sharing options...
NotMyFault Posted March 9, 2021 Share Posted March 9, 2021 If would help if you second my request for better documentation Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 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. Link to comment Share on other sites More sharing options...
NotMyFault Posted March 9, 2021 Share Posted March 9, 2021 and this Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 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. Link to comment Share on other sites More sharing options...
NotMyFault Posted March 9, 2021 Share Posted March 9, 2021 actually, out of curiosity I'm trying to document them on my own. Lots of googling, trial & error, and reverse engineering. We should start a new thread to collect all user-generated documentation. dmstraker 1 Quote Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080 LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5 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. Link to comment Share on other sites More sharing options...
dmstraker Posted March 9, 2021 Share Posted March 9, 2021 36 minutes ago, NotMyFault said: actually, out of curiosity I'm trying to document them on my own. Lots of googling, trial & error, and reverse engineering. We should start a new thread to collect all user-generated documentation. Definitely. I'm into Procedural Texture programming and would like to know more. Aside: I program in PT using Excel -- one statement per line, comment in next column, then concatenate all lines to cut/paste to PT. Conditionals are a pain but doable. NotMyFault 1 Quote Dave Straker Cameras: Sony A7R2, RX100V Computers: Win10: Chillblast i9 Custom + Philips 40in 4K & Benq 23in; Surface Pro 4 i5; iPad Pro 11" Favourite word: Aha. For me and for others. Link to comment Share on other sites More sharing options...
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.