After Toolkit > Modifiers > Matte
Turn your layers into black and white precomps
Transform anything into a black and white matte.Matte turns your selected layers into black and white precomps. A useful script to quickly generate mask layers from the layers' transparency or their luminance.
Matte - Quickstart Guide
Open your After Toolkit, select your layers, and click on Matte.You can generate your matte from your layers' Alpha channels or from their Luminance.
Adding a solid background will generate a solid black background to the matte precom.
The matte precomp can be cropped or not, and inverting the matte will make it black on white.
Lastly, you can embed a blur into the precomp and add a suffix to its name.Everytime you apply custom settings, they are saved for the next time you use it again. Reset to default values will revert to original settings, before you ran it for the first time.