Question: I have an image with a few bright pixels with the remaining ones very dark. The difference is in orders of magnitude.

I want to binarize this matrix (corresponding to the image) making all values zero besides the few bright ones. 

The function Binarize does what I want but it accepts only an image as an input. So indeed I can use the plot of the matrix as input but that messes up things because the image includes the axis, labels etc...

How can I do this? Any help will be appreciated.

Answer: 
`Clip` seems perfectly suited:

```
mat = RandomReal[{0, 10}, {100, 100}];
Manipulate[
 MatrixPlot[Clip[mat, {threshold, threshold}, {0, 1}]],
 {threshold, 0, 10}
 ]

```

![enter image description here](https://i.stack.imgur.com/cdXoV.png)

Here we use the form of [`Clip`](http://reference.wolfram.com/language/ref/Clip.html) with three arguments:

```
Clip[mat, {threshold, threshold}, {0, 1}]

```

It takes everything below `threshold` and sets it to `0`, and takes everything above `threshold` and sets it to `1`. You can change both thresholds and the extreme values, eg

```
Clip[Range[10], {5, Infinity}, {0, 1}]

```

which sets everything below `5` to `0` and does nothing else (the `1` does nothing the way I wrote it).
Unfortunately

```
Clip[mat, {threshold, threshold}, {0, 1}]

```

is not correct, because a value in "mat", which is exactly "threshold" will not be changed.
This just works for values < "threshold" and > "threshold".

Maybe this would be a solution for binarizing a matrix:

```
mat/.{x_/;x<threshold->0, x_/;x>=threshold->1}

```