Jump to content

Recommended Posts

Posted

This is a very technical question and a very long shot, and I am not necessarily mathematical enough to understand a technical answer!

Back when I used Corel Draw there were three blend modes I haven't seen elsewhere: And, Or and Xor. I did many pieces of work using the And mode for a particular effect.

My question is, does a tool such as Procedural Texture allow the creation of such a custom blend mode (or to mimic it) and how would something such as the And calculation be formulated? I haven't yet found anything explaining the nuts and bolts of the And mode in Draw.

I see things written about And gates, such as the equation is Y=A.B but I don't know how this relates to creating the solution.

Anybody clued up on this kind of thing? Thanks!

Posted
1 hour ago, tonyrambler said:

does a tool such as Procedural Texture allow the creation of such a custom blend mode (or to mimic it) and how would something such as the And calculation be formulated?

The search returns many results, but among them are also quite a few examples: 
forum.affinity.serif.com/index.php?/search/&q=Procedural Texture

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Posted

I was using it in Corel Draw for shapes with gradient fills. Often the shapes were just rectangles over the entire area of the design, as it was the gradients I wanted.

Here's a portion of one example. This is two overlaid gradient filled rectangles, one radial and the other (probably) conical, blended using And. Ignore the star effect, it is just the background colouration effect that's important.

I haven't found a way to recreate this yet without Draw.

And blend.jpg

Posted

First, procedural texture filter is unable to do layer blending on its own. The input values always take the colors from layers below, actually one value, not multiple values from specific layers.

What you are looking for is apply image filter. There you can blend 2 images by a self-provided formula.

https://affinity.help/photo2/en-US.lproj/pages/Filters/imageBlending.html

The help is quite sparse about which functions are available. I think you can use some or most of those listed in procedural texture filter.

The disadvantage of the filter is the bad UI: You cant save formulas as presets, and need to enter everything again from scratch. It is destructive. No non-destructive version exists.

Macros may help to overcome some of the limitations.

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.

 

Posted

Operations like and, or, xor maybe could be simulated with existing blend modes and / or blend ranges.

Could you provide the exact definition on how these functions work on the individual RGB color channels?

I found some old reports saying is using bitwise and/or/xor - this would be difficult to achieve in Photo because these functions are not available out of the box, and simulating bitwise functions with idiv / irem etc is high effort

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.

 

Posted

Hi NMF, thanks for those details. I'll look at Apply Image later when I have some clear-headed time.

I searched what I could find on CDraw blend modes but can't find a definition of how And or Or work, only found Xor on one forum. I'm not even certain that Draw still includes And. As you can imagine, it's also a very frustrating search term to have to use. It's almost impossible to search for in any specific way, so I've had to look for complete docs on blend modes but can't find the formula listed.

Thank you for your suggestions.

Posted

Can I clarify, are we talking about Layer blend modes in Corel Photo-Paint?

List of blend modes from Corel Photo-Paint below?
image.png.fb9fbbed8d3a0a6eafd708a268c08cc7.png


or the Effect in CorelDraw of blending two objects characteristics, such as colour shape etc.

Note: Defo Corel Photo-Paint not CorelDraw, although Photo-Paint is part of CorelDraw Suite.

UPDATE: Found the the Merge Modes in CorelDraw under an objects Properties and on the Transparency Tab.
image.png.fadd29e814efc9603499f092f9b933e9.png

 

iMac 27" 2019 Sequoia 15.0 (24A335), iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Posted
1 hour ago, tonyrambler said:

I'm not even certain that Draw still includes And.

For APh see:

... though it doesn't offer any logical AND/OR/XOR blend modes.

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Posted

By example maybe we can create effects that resemble the results shown below.

Base Gradient
439005350_BaseGradient.thumb.png.84cd69ccf5d97082e7031e50cb5258bd.png

Logical OR
1145554309_LogicalOR.thumb.png.767da3e16548abbfa1242968402c065f.png

Logical XOR
887109778_LogicalXOR.thumb.png.e0c7d0682be8ea585d3eee86191131e8.png

Logical AND
1664314524_LogicalAND.thumb.png.37187249fb4fbd93866f442a95f05375.png

iMac 27" 2019 Sequoia 15.0 (24A335), iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Posted

It is possible in theory, but the formula for apply image will be huge, possible larger than the allowed input length.

unfortunately we have no basic logic functions, except not (x) = 1-x. This even works for 8 bit integers

For and, we can use *,

for or +,

for xor (a,b) = a*(1-b) + (1-a)*b

but these work only for 1 bit (0 / 1).

We can extract 8 bits from a color value with idiv / irem and suitable factors, e.g.

irem(idiv(x*255,128),2) for bit 7

irem(idiv(x*255,64),2) for bit 6

so you could build a formula by extracting individual bits, from individual color channels, for src and dst layer, and combine them.

8 * 3 formulas with 2 inputs, plus combining the bits by ((b7*2+b6)*2+b5)*2 ….. )*2+b0.

maybe next year.

I have done a PT filter to convert RGB to HSL and back, this took me about a month.

 

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.

 

Posted
22 minutes ago, RichardMH said:

Are you sure you can do this with curves and geometry?

geometry.thumb.jpg.6d01ece98345607899f1ea67c3234ca1.jpg

It's not Geometry functions Richard, it's Blend modes, how layers above affect colours when using a particular blend mode from the layers panel, what you are showing would result in a different shape if two curves were selected. 

iMac 27" 2019 Sequoia 15.0 (24A335), iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Posted

iMac 27" 2019 Sequoia 15.0 (24A335), iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Posted

Thanks everyone for the continued inputs. I will be looking at the earlier replies in more detail when I have some free time. For clarity, all of my work using (Logical) And mode was always in Draw, not PhotoPaint, as my work was all vector based.

FirstDefence—yes, those are something like I was producing, but always in Draw.

None of the Affinity modes replicate the effect, including Multiply. 

RichardMH, I think I see what you are getting at. I have actually done a couple of pieces where I mimicked the approximate effect by combining shapes and things like that, but it's a very tiresome workaround and it doesn't provide the organic variations of the blending modes. Thanks. 

Tony

Posted
4 hours ago, tonyrambler said:

FirstDefence—yes, those are something like I was producing, but always in Draw.

Yeah just updated a previous post to correct wrong info but I'll reiterate here, the Blend(Merge Modes as Corel call them) were under an objects properties on the Transparency Tab.
image.png.fadd29e814efc9603499f092f9b933e9.png

iMac 27" 2019 Sequoia 15.0 (24A335), iMac 27" Affinity Designer, Photo & Publisher V1 & V2, Adobe, Inkscape, Vectorstyler, Blender, C4D, Sketchup + more... XP-Pen Artist-22E, - iPad Pro 12.9  
B| (Please refrain from licking the screen while using this forum)

Affinity Help - Affinity Desktop Tutorials - Feedback - FAQ - most asked questions

Posted
14 hours ago, lacerto said:

exporting to PSD with layers, and then opening them in GIMP, and applying G'MIC blend modes might be one possible route worth an effort.

Also, VectorStyler has AND, OR, XOR, NOR blend modes.

Posted
1 hour ago, lacerto said:

One possible scenario for experimenting with logical blend modes and retaining vector format would be doing the blending in VectorStyler, making a copy of the blend group, applying Boolean Division, and then copy pasting the blend color values using a color picker to the divided (flattened) vector shapes (the blended color values are unfortunately lost when dividing), and finally copy pasting to Affinity apps.

VS now has a Flatten command to perform transparency flattening, but it currently disregards blending modes of the source objects when calculating the colours of the resulting fragments, making the result wrong except for when source objects have Normal blending mode.

Posted

Sorry but this is the first time I'm looking at these blend modes.

In the Krita manual, the "AND" blend mode example shows two fully opaque gradients. But after changing to "AND", apparently the result is partially transparent.

It looks that the RGB data affects alpha. Am I interpreting the manual correctly?

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.