What blend mode can give me that effect?

Get help using Construct 2

Post » Fri Apr 22, 2016 10:05 am

Zathan wrote:
Gigatron wrote:@Zathan
If it's become invisible with Overlay blend then we can continue the test like this ;

if (back.r<0.1 && back.g<0.1 && back.b<0.1 ) {front.r=1.0;front.g=1.0;front.b=1.0;} // set to white


Hehe awesome!
how did you do it? Can't be done by events, right?

There is always a solution with C2...This partially solve your problem, i have done this quickly
and will PM you to the link of the file.

Posts: 873
Reputation: 24,236

Post » Fri Apr 22, 2016 12:49 pm

Hey Zathan, :)

I'm not positive, but I think the blend mode shown in the image is a "Value" (aka Brightness) preserving blend, based on the HSV color space.

I think the Luminosity blend mode in C2 is a "Lightness" preserving blend, based on the HSL color space.

HSL and HSV are similar, but ...

In HSL, setting "Lightness" (L) to 100% will turn any color pure White, regardless of what it was to begin with. That's likely why the Luminosity blend didn't recreate the effect you were looking for.

In HSV setting the "Value" (V) to 100% will turn pure Black to pure White and will turn any color to the brightest possible version of that color which preserves the RGB ratios, thus preserving hue.

I've used a lot of image processing tools and in my experience a "Value" based blend is a pretty uncommon thing which is why C2 likely doesn't have one built in. That said, it can definitely be added thanks to C2's extensibility. :)

Here is an example in which I "Value" blend white rectangles into the same image you provided.

The results appear to be essentially identical.

What's going on
Because the white square has a "Value" of 100%, it turns black to white, and boosts the colored areas such that for every pixel, the largest RGB component is maxed and the other components are scaled up proportionally preserving the original hue.

This makes sense if you think about how it affects black. For black, the RGB values are all the same (0,0,0), so the maximum among them is "0". If you slide the "max" value of 0 up to 100%, and then slide the other values up (also zeros) to maintain the same ratio of RGB amounts, then all the values will now be 100%.

Likewise, for a color like a dark orange ( 50%, 25%, 0% ), setting it's "Value" to 100%, will make it a bright orange. The max among the RGB components is the 50% red. If you slide that 50% up to 100% (maxing it out) we have doubled it, and so to preserve the relative RGB ratios we double the other values as well. So we go from dark orange ( 50%, 25%, 0% ), to bright orange ( 100%, 50%, 0% ), and voila, we've maxed out the brightness ("Value") without changing the RGB ratios.

A side effect of the HSV formula is that colors will never get blown out, or clipped, the way they will if you use an addition-based formula.

Seeing it in HSV color space
Finally, here I've taken your original image and broken it into individual channels in the HSV color space.

H: hue
S: saturation
V: value

As you can see, the "Value" channel has your white square simply pasted directly into the channel data, perfectly overwriting everything it overlaps with the "HSV Value" of white, which is 100%. However, the hue and saturation data from the background image are preserved.

So in summary. I think its "Value" blend. :)
Posts: 351
Reputation: 6,733

Post » Fri Apr 22, 2016 8:47 pm

Wow, that's an awesome explanation! hehehe

Guys, thank you very much for all the help! It's propably the best forum ever..
People who know what they're doing and want to help.

Again, thank you!
Posts: 387
Reputation: 2,274

Post » Fri Apr 22, 2016 9:46 pm

Happy to help. :)

And yeah the C2 forums and community are pretty awesome. Everyone I've encountered has been really nice and helpful. :)

I can make a Value/Brightness blend effect shader for you, though it may be a day or two before I can get to it, if that's okay.
Let me know if you need it sooner.
Posts: 351
Reputation: 6,733


Return to How do I....?

Who is online

Users browsing this forum: PitfallJerry and 8 guests