11 Overlays
Overlays are non-active selections displayed ‘over’ the pixel data, on the image overlay, and are the core of non-destructive image processing in ImageJ. In a way you can think of the image overlay as an invisible
ROI Manager↓ in which selections are being added, allowing ROIs to be on ‘hold’. This concept of multiple distinct selections has been dramatically improved in
ImageJ2↑ so we urge you to download IJ2 if multiple ROIs are important in your workflows.
Importantly, overlay selections are
vector graphics composed of mathematically-defined paths (as opposed to
raster graphics in which objects are defined by pixels) and are not affected by scaling, i.e., do not become pixelated. Most of overlay-related commands are listed in the , and in the ROI Manager window (). Appearance of overlay selections can be adjusted using /
As mentioned in
3: Image Types: Lossy Compression and Metadata↑, overlays are saved in the header of tif images, and do not need to be saved externally when using TIFF, the default file format of ImageJ. The major advantages of overlays are summarized below:
Storage of ROIs In ImageJ it is only possible to have a single ROI at a time. However, it is possible to add selections to the image overlay using B (). Once added to the image overlay, ROIs can be re-activated by Alt-clicking, Control-clicking or long-pressing (1⁄4 second or longer). Activated ROIs can be deleted by pressing the Backspace key. Selections can also be added and recovered in bulk, using the / commands.
Non-destructive annotations Overlays are the best way of annotating images in ImageJ (
examples↓). As vector graphics, overlays do not change pixel values, can be scaled without loss of quality even at high zoom levels (
see 19: Working with Zoomed Canvases↓) and can be displayed at different opacity values (
see 20: Hexadecimal Color Values↓). RGB snapshots of the image with embedded overlays can be created by holding
Shif F, the shortcut for . ‘Flattened’ images with the overlay rendered as pixel data are also created when saving the image as PNG or JPEG (), or when printing the image canvas (). The command is also listed in the
ROI Manager↓.
Image ROIs An imageROI (image selection) is a ROI that displays an image as an overlay. As described in and , this allows multiple images to be blended on a single image canvas.