// Beyond the Digital Zone System Zone Ruler macro for ImageJ // Requires Color_Transformer_2.class. // This macro measures the mean L* values and signal-to-noise ratios (mean / standard deviation) // of an exposure series, stitches the images into a zone ruler, and displays a simple plot. // Images should be small crops of out-of-focus photographs of a uniform surface, // about 50-100 pixels square. (The SNR “reference image” is just pixels of the mean value.) // Use 8- or 16-bit RGB .tif, .jpg, .png, .gif, or .bmp images. // Place them into a folder, run the macro, and select the folder. // You will be prompted to choose the lowest zone in the image series, and the images’ color space. // Custom color spaces may be added to Color Transformer 2. However, as exposure series images generally // occupy a very small gamut, and L* is all that is being measured, another profile with the same gamma // (such as Adobe RGB for 2.2, ProPhoto RGB for 1.8) will probably do. // 2/22/2014 by Russell Cottrell. Please visit russellcottrell.com/photo/BTDZS/ . macro "BTDZS Zone Ruler" { setBatchMode(true); dir = getDirectory("Choose an Image Folder"); dirName = File.getName(dir); bigList = getFileList(dir); list = newArray(); LL = bigList.length; for (i=0; i 0) { for (i=0; i 3) { // plot the values xValues = newArray(); for (i=0; i 12) frameWidth = frameWidth + (64 * (LL-12)); else if (LL < 7) frameWidth = frameWidth - (116 * (7-LL)); Plot.setFrameSize(frameWidth, 450); Plot.setJustification("center"); Plot.addText("Zone " + toString(lowestZone + 1, 0), 1/(LL-1), 0.6); Plot.addText("Zone " + toString(lowestZone + LL - 2, 0), (LL-2)/(LL-1), 0.25); Plot.setColor("red"); Plot.setLineWidth(6); Plot.add("dots", xValues, y2Values); Plot.setLineWidth(2); Plot.add("line", xValues, y2Values); Plot.addText("SNR " + toString(y2Values[1]), 1/(LL-1), 0.7); Plot.setColor("blue"); Plot.setLineWidth(6); Plot.add("dots", xValues, yValues); Plot.setLineWidth(2); Plot.add("line", xValues, yValues); Plot.addText("L* " + toString(yValues[1]), 1/(LL-1), 0.65); Plot.addText("L* " + toString(yValues[LL-2]), (LL-2)/(LL-1), 0.3); Plot.setLineWidth(1); Plot.show(); } for (i=0; i