from ij import IJ image = IJ.openImage("/path/to/image.tif") rois = image.getRoiManager().getRoisAsArray() roi = rois[0] roi.setStrokeColor(Color.RED)
from ij import IJ image = IJ.openImage("/path/to/image.tif") title = "Example Text" size = 24 font = Font("Arial", Font.BOLD, size) x = 50 y = 50 overlay = image.getOverlay() textRoi = TextRoi(x, y, title, font) textRoi.setStrokeColor(Color.BLUE) overlay.add(textRoi) image.show()The package library used for these examples is the ImageJ library.