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: 
The simplest and fastest way to binarize a matrix directly without image conversions is with `UnitStep`:

```
matrixBinarize[mat_List, val_?NumericQ] := 
   UnitStep[Subtract[mat, val]]; (*Subtract is faster than mat - val*)

```

To automatically find a threshold like `Binarize` does:

```
matrixBinarize[mat_List] := matrixBinarize[mat, FindThreshold[mat]];

```
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}

```