/* Macro removes dark borders of all tiff images in "source folder", and stores the resulting 8-bit images by default in a sub-folder called 'Clean'. Names of cleaned files end with '_c.tif' Usage: 1. Open one of the tiff files of source folder 2. Run the macro 06.06.2025, 17:55 */ macro "Remove Dark Borders"{ suffix = "_c"; //for cleaned file name convexHull = true; srcDir = getDir("image"); list = getFileList(srcDir); if(list.length== 0 && (srcDir.contains("/Desktop") || srcDir.contains("/Downloads"))) exit("Desktop or Downloads access not allowed?"); print("\\Clear"); print("-- SrcDir: --\n", srcDir, "\n \n-- srcFiles: --"); nTifs = 0; tiffTitles = ""; for (i=0; i