Blend Modes
Moderators: MtnViewJohn, chris, mtnviewmark
Blend Modes
I think it would be useful for some designs to have different blend modes.
For example, if you want to draw sparks or other light effects you would use a additive mode.
https://en.wikipedia.org/wiki/Blend_modes
For example, if you want to draw sparks or other light effects you would use a additive mode.
https://en.wikipedia.org/wiki/Blend_modes
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Blend Modes
The cross-platform graphics library, AGG, supports all of the blending modes, but I have only used the default source-over-dest mode. I can look into adding blending mode to the shape state.
Re: Blend Modes
I look forward to playing with it!
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Blend Modes
Hi Mycelium,
I'm preparing a beta of Context Free v3.3 with this blending feature for you to check out. Do you use Windows or Mac?
I'm preparing a beta of Context Free v3.3 with this blending feature for you to check out. Do you use Windows or Mac?
Re: Blend Modes
I use mac os
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Blend Modes
Right now what I have implemented is a blend adjustment that you add to a shape that changes the blending mode for that shape and all of its child shapes:
The flag following the blend keyword is either a Porter-Duff compositing mode:
CF::Clear, CF::Src, CF::Dest, CF::SrcOver, CF::DestOver, CF::SrcIn, CF::DestIn, CF::SrcOut, CF::DestOut, CF::SrcAtop, CF::DestAtop
Or a color blending mode:
CF::Xor, CF::Plus, CF::Multiply, CF::Screen, CF::Overlay, CF::Darken, CF::Lighten, CF::ColorDodge, CF::ColorBurn, CF::HardLight, CF::SoftLight, CF::Difference, CF::Exclusion
You don't have to remember all of these, there is a new menu item under the Edit menu: Insert Blend/Composite.
But I really don't know if this is the right way to do it. Is it correct to mix together blending and compositing and only allow one of the total at a time? Should designers be able to specify a blending mode and a compositing mode?
ETA: From reading the CSS Compositing and Blending spec it looks like I need to provide blending and compositing as separate operations. I will create a composite/comp adjustment to complement the new blend adjustment.
Code: Select all
SCENE { blend CF::Xor x 0.25 y -0.25 s 0.5 alpha -0.2}
CF::Clear, CF::Src, CF::Dest, CF::SrcOver, CF::DestOver, CF::SrcIn, CF::DestIn, CF::SrcOut, CF::DestOut, CF::SrcAtop, CF::DestAtop
Or a color blending mode:
CF::Xor, CF::Plus, CF::Multiply, CF::Screen, CF::Overlay, CF::Darken, CF::Lighten, CF::ColorDodge, CF::ColorBurn, CF::HardLight, CF::SoftLight, CF::Difference, CF::Exclusion
You don't have to remember all of these, there is a new menu item under the Edit menu: Insert Blend/Composite.
But I really don't know if this is the right way to do it. Is it correct to mix together blending and compositing and only allow one of the total at a time? Should designers be able to specify a blending mode and a compositing mode?
ETA: From reading the CSS Compositing and Blending spec it looks like I need to provide blending and compositing as separate operations. I will create a composite/comp adjustment to complement the new blend adjustment.
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Blend Modes
After looking at this further I think that implementing full blending and compositing would require a much more complicated drawing model. So I am only doing color blending.
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Blend Modes
There is a beta version with blending modes at ContextFree3.3beta.dmg
Re: Blend Modes
Hello John,
I downloaded the beta version that seems to work good on my Mac (mac os x 10.14.6). I think that having color blending is useful, I hope to post soon an example in the gallery!
Compositing operation maybe would require to split current "alpha" command in two:
* "alpha" that paints on the global alpha map of the image (and could be both positive and negative);
* "opacity" that only specify the transparency/opacity of the current color;
But I don't know if this feature is a big improvement considering the possible ambiguity of the two commands.
Just for brainstorming:
A thing that could be nice, maybe, to have an additive mode where colors keep luminosity while changing the hue, and also progressively "burn" to white when go over maximum value of a single RGB channel. Something like the simulation of light captured by a camera.
thanks!
I downloaded the beta version that seems to work good on my Mac (mac os x 10.14.6). I think that having color blending is useful, I hope to post soon an example in the gallery!
Compositing operation maybe would require to split current "alpha" command in two:
* "alpha" that paints on the global alpha map of the image (and could be both positive and negative);
* "opacity" that only specify the transparency/opacity of the current color;
But I don't know if this feature is a big improvement considering the possible ambiguity of the two commands.
Just for brainstorming:
A thing that could be nice, maybe, to have an additive mode where colors keep luminosity while changing the hue, and also progressively "burn" to white when go over maximum value of a single RGB channel. Something like the simulation of light captured by a camera.
thanks!
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Blend Modes
I uploaded a new beta ContextFree3.3beta.dmg with an additional blending mode: CF::Clear. Technically, this is a Porter-Duff compositing mode. The CF::Clear "blending" mode draws with transparency. It allows you to punch transparent holes into shapes.