how to limit value levels
I wish to achieve an effect like this:

Where Photoshop groups pixels by value into several levels. In the example above there's 3 levels: Black, Dark Gray and Light Gray - and nothing in-between. That's what I'm going for but I don't know how to do that
