Answer
Open a photograph in Photoshop
Do Image > Adjusments > Desaturate
Then Image > Mode > Indexed color, and use the settings shown below.
Note: Afterwards, you can switch back to other modes such as RGB for further editing, by using Image > Mode > RGB
Attribution
Source : Link , Question Author : jomo , Answer Author : Billy Kerr