Read and write NumPy arrays as TIFF images