It's a threshold adjustment layer.
Play with curves & exposure like
>>464914 says (if you need more fine detail, you can add a high-pass filter before the threshold adjustment, though expect to manually erase portions of this since it can sometimes retain too much detail), then drop threshold on top. Threshold basically makes all colors in the image either fully black or white, with no grey values
Flatten the image, then Magic Wand select all the black & copy onto a new layer. Put this on a solid color background. From there you manually paint the colors back in underneath