BinaryAlpha v1.0


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Tony Lyons
Analyzes a choice of the RGB, RGBA, or Alpha input and outputs an Alpha Channel (or RGBA) that is Binary, 0 or 1. Any Pixels that are not 0 will be turned into 1 (negative numbers also), and 0 will remain 0. This is perfect for those blur + unpremult tricks or if you need a quick matte for finding any rgb color above or below 0, in a CG render passes for example.
Requirements:
11.0, 10.5, 10.0, 9.0, 8.0, 7.1, 7.0, 6.3, 6.2, 6. or later
Linux, Mac, Windows
02 Jul 2019
310

BinaryAlpha_SplashPage_v01.jpg

Binary Alpha is a very simple, yet super convenient expression that I use all the time, and decided to turn into a quick gizmo.

It analyzes a choice of the RGB, RGBA, or Alpha input and outputs an Alpha Channel (or RGBA result) that is Binary, 0 or 1.  Any Pixels that are not 0 will be turned into 1 (negative numbers also), and 0 will remain 0. 

This is perfect for those 'blur, unpremult, set alpha, blur' for tricks extending colors, or if you need a quick matte for finding any rgb color above or below 0, in a CG render passes for example.

The good ol' blur/unpremult/blur
BinaryAlphaExample_v03_copy_2.gif


Basic properties:

binaryAlphaSettings_jpg.jpg

The literal tcl expression is just:

r!=0 || g!=0 || b!=0 || a! = 0 ? 1 : 0

Which in english, translates to something like:
'if red is not 0, or green is not 0, or blue is not 0, or alpha is not 0, then be 1, or else, be 0'
So it will include negative pixels as an output as 1 as well.


Super simple but hopefully a time saver if you are like me and hate remembering expressions.

You can also download this tool at my github, where you'll find all my public tools in one place:
https://github.com/CreativeLyons/Lyons_Tools_Public/blob/master/04_Channel/BinaryAlpha.nk

Enjoy


Please login in order to download these files.

Comments   

 
+2 # ankur suvarapu 2019-10-21 05:09
Thanks tony, I love your tuts and gizmos
 

You have no rights to post comments

We have 4351 guests and 132 members online