How to remove bright aspecific speckles

Hi - in the image below you can see a dim real staining in the center, with vascular features, but also a bright dotted aspecific staining at the edge of the tissue. Any recommendations on how to remove the latter? Thanks!

You could either crop the image to exclude the areas you are not interested in. Alternatively, if there is a clear difference between the non-specific bright pixels and the specific staining, you could replace all pixels above a certain threshold with 0 (or an average background pixel intensity). This can be done using 'Threshold, followed by ‘Make Selection’ and ‘Fill’. In a macro you could do this with the changeValues() command.
Hope this helps,

changeValues(v1, v2, v3)
Changes pixels in the image or selection that have a value in the range v1 - v2 to v3 . For example, changeValues(0,5,5) changes all pixels less than 5 to 5, and changeValues(0x0000ff,0x0000ff,0xff0000) changes all blue pixels in an RGB image to red. In ImageJ 1.52d or later, use changeValues(NaN,NaN,value) to replaces NaN values.

One short remark: If you want to do this for an analysis pipeline @Volko’s approach is an option. If you want to make the image look more “beautiful” for a publication, then removing the dots is not an option for good scientific practice reasons (no original part of the image should be removed in scienific reporting). If it is for publication you can discuss the origin of the unspecificity.


Just wanted to extra emphasize this :slight_smile:

1 Like

Thanks @Volko I tried already to replace pixel values above a certain threshold, however, this leads to a sharp edge between the replaced pixels and the surroundings, which becomes even more emphasized after enhancing contrast. I was thinking something that smooths like a bandpass filter, and then subtracting it from the original.

Thanks @biovoxxel and @Research_Associate it is for a pipeline as this image is one of a stack.

1 Like

Hi Ferdinando,
I think it would be useful if you could explain why the bright pixels are an issue in your analysis pipeline. What do you try to achieve? Depending on your aims, it might be possible to exclude the areas of the bright pixels from the final analysis. For example, if you intend to segment some of the fainter staining in the centre, it might be possible to first do a segmentation that picks up your signal of interest plus the bright pixels at the edges. Then do a second segmentation that picks up only the bright pixels at the edges, and then subtract the two from each other.
I guess you could also try to use some AI approach to try to pick up your signal of interest.
But as suggested by the other comments, I would not recommend to try to make it look like these pixels don’t exist.


Hi Fernando,
as Volko wrote, try to find the reason for these bright pixels and get rid of them. If this is not possible, because you cannot take the images again (e.g. samples not available any more):
To get rid of the sharp edge, you can threshold the image such that only the bright areas are selected, Edit>Selection>Create selection and Edit>Selection>Enlarge. Then set the area to whatever value you like. If required, also run ‘Smooth’ or some smoothing filter with that selection to get smooth borders (it may need smoothing a few times).
Obviously, such a treatment is meant for facilitating further processing steps, not for showing the images in a publication or the like. When processing the images, make sure that you exclude the white areas in any calculations of area fractions, etc.
Also beware that excluding such areas will increase the error bars of any quantitative analysis since it is not know what the image should look like in these areas.
– Michael

1 Like

Just to clarify and for the records, I have control samples showing those bright spots are aspecific. Thus, I do not think it is wrong to try to exclude them, even for visualization. Of course, we will try to avoid that in next experiments, for example by using less primary antibody (which is a polyclonal).

Hi, I have a similar issue. In my case the speckles and blobs are disseminated across the entire sample. I am staining brain organoids to detect myelin (PLP) and I see this problem only when staining myelin, even if I use other markers. I am working in my protocol to address the issue. I would like to know if there is a way to reduce the speckles. I am not using the images for publication but I am presenting preliminary data and the speckles are quite distracting. Any suggestions are greatly appreciated. By the way, I am new to fiji