Advice on creating Gradient Mapped 2 color images

Using a standard photo from the camera roll how could I then be able to play with the pixels to then be able to do duo-tone gradient map processing live?
I’d like to be able to play with the pixels live(ish), but I’m unsure about how intensive these processes can be, seen as this will only be the background of the app and there’s a lot of sound fun times running on top

found out the i didn’t mean duo-tone, i meant gradient map, so here is a link to it being answered - Gradient Map on image