Thresholding for grayscaled images

Is there a way to make it so that below a certain threshold; everything becomes black, but above it; the whiteness stays the same as the original?

(For a grayscaled image)