G'MIC and Color to Alpha equilavent

Does G’MIC have something similar to Color to Alpha in Krita/GIMP? I can’t seem to find it. Lack of sleep though, hence the timing here.

flood seems to be closest. But, I’d like it as a new layer of single channel representing selection.

There is also replace_color but i’m not sure it can replace with alpha.

Or maybe you’ll have to use select_color to create a mask?

Old topic, but just in case it can be of help to someone.

I once needed a similar thing and here’s my take:

gmic.exe “inputimage.png” 100%,100%,1,3,“>[ 255,255,255 ]” sub_alpha[0] [1] normalize 0,255 output[0] outputimage.png

Takes the inputimage adds an all white (the 255,255,255) picture the same size (the 100%,100%) and applies a sub_alpha filter on them.
Use 0,0,0 for black of course.
In batch files you use 100%%,100%% instead of a single % to avoid the percent symbol from being misinterpreted.

You can modify it to use the sub_alpha’s AlphaConstraint option if needed.

And in the end I added a normalize, but mainly because I tend to always do it to avoid issues with things getting out of range in experiments and me ending up with confusing black pictures.