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: 
As you note [`Binarize`](http://reference.wolfram.com/mathematica/ref/Binarize.html) does just this:

> 
> `Binarize[image,t]`  
> 
>  creates a binary image by replacing all values above `t` with 1 and others with 0.
> 
> 
> 

Therefore you merely need to convert your data into an `Image`. First some test data:

```
m = Array[Plus, {21, 21}, -10];
m // MatrixPlot

```

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

Now we convert to an `Image`:

```
img = Image[m]

```

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

Do not worry that the data already appears binarized; it is still there:

> 
> `Image[data]` by default allows any real number, but displays only values between 0 and 1.
> 
> 
> 

We can still `Binarize` at any value within the range of the original array:

```
Binarize[img, #] & /@ {-18, -11, -4, 0, 4, 11, 18}

```

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

If you wish to recover the numeric data use [`ImageData`](http://reference.wolfram.com/mathematica/ref/ImageData.html):

```
Binarize[img, 11] // ImageData // MatrixPlot

```

![enter image description here](https://i.stack.imgur.com/iqOHg.png)
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}

```