ffmpeg lutrgb to create zebras
Assuming your input is full range RGB when fed to the filter, then something like

geq=r='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),15,750),p(X,Y),if(lt(ld(1),15),C1R,C2R))':
    g='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),15,750),p(X,Y),if(lt(ld(1),15),C1G,C2G))':
    b='if(between(st(1,r(X,Y)+g(X,Y)+b(X,Y)),15,750),p(X,Y),if(lt(ld(1),15),C1B,C2B))'


Here the two colors are (C1R,C1G,C1B) and (C2R,C2G,C2B). with each component range being 0-255.

The 15 and 750 are the thresholds for selecting black and white pixels. The sum of the values of the three components for each pixel is compared to those values.

The st and ld functions are store and load functions with the first argument being the 'register no.'.

You can also try the colorkey filter.