no test, and not sure to work, and I not sure to understand it

in photoshop you can use the levels(in "new fill or adjustament layer)

you need touch the output levels for create a three grey scale files, the first from 0 to 82, the next from 83/82? to 164 and the three from 164/165? to 255.