You can do it programatically. Color operations like these are quite simple, but doing it programmatically still requires tweaking.
Let's say you have the RGB color model for your image, then each channel (Red, Green, Blue, respectively) has a value. In gray-scale images (one channel: Gray) all these values (Red, Green and Blue) are equal, thus basically there is only one channel (the Gray).
Your goal is to create two new channels (duotone), which are the color A and color B. (A, B, resp.) I presume the effect you need is that A and B is either present or not at a certain location. Thus possible values per location are A, AB, B and none.
You have to iterate over the locations of your image (probably pixels), and translate the original colors (from RGB or G, to the duotone).
There are several techniques for translating them, but let's keep it simple: the image has only one channel, G, and we will apply a threshold filter:
threshold = 0.25
IF G < (0.5 + threshold) THEN A
IF G >= (0.5 - threshold) THEN B
For instance, with these values for G:
G AB
0.0 A
0.1 A
0.2 A
0.3 AB
0.4 AB
0.5 AB
0.6 AB
0.7 AB
0.8 B
0.9 B
1.0 B
Now you only use three of the four possible values in the duo-tone. The following will do better:
thresholdA = 0.25
thresholdB = 0.5
IF G >= thresholdA && G < (1 - thresholdA) THEN A
IF G >= thresholdB THEN B
G AB
0.0
0.1
0.2 A
0.3 A
0.4 A
0.5 AB
0.6 AB
0.7 AB
0.8 B
0.9 B
1.0 B
You will have to tweak the thresholds. If you let the tweaking be done in a GUI, then you've created your own (minor) Photoshop :-)