added header, plate-level flags, tiff support, changed output thresholded quality