Image overlaying


Hi, I am analyzing an image using the Analyze>Analyze particle.
I want to overlay the outline image with the origin image with a different color. In other words, i want to get the overlaying zone with a different color
If not, how can I change the color of an image (eg : from black to red)



I can think of two ways to do what (I think) you want to do. Both have their advantages.

1) Add a new channel
Once you have your outline from Analyze Particles, invert it ( Edit > Invert ) to get the outlines white on a black background, then merge it back with your original image ( Image > Color > Merge Channels ) selecting appropriate colours. Below I’ve used blobs and have merged the original as greyscale with the overlay as the red channel.

Note you now have a two channel image so you can change the look up table on either as you please or flatten it into an RGB image.

2) Overlays
Do the same as above to get your outlines then use the mask (labelled “Drawing of mask” above) to create a selection ( Edit > Selection > Create Selection ), select the original image then restore the selection by running ( Edit > Selection > Restore Selection ) now you can use the selection to create an overlay by running ( Image > Overlay > Add Selection ).


You now have a non-destructive overlay on your original image. A possible advantage of this method is that it doesn’t require a blending of the channels as does the composite above.


Hi Fares,

To change color of an image you can find explanation here

and to merge 2 images : Image > Color > Merge Channels…




You can do this using an overlay. The following example macro outlines the particles selected by Analyze>Particles in red.

  run("Blobs (25K)");
  run("Analyze Particles...", "size=300 show=Overlay");
  run("Overlay Options...", "stroke=red width=2 set apply");