This is a Z shell script for replacing all TIFF files in a directory with compressed PNG files that have nearly the same information.
This utility is intended for use with
usage: ti-ff [ -h | --help | -? ] [<directory>]
This script finds all TIFF files in the current directory (or the provided directory) and converts them all to PNGs using LibTIFF’s tiff2png
command. The resulting PNGs are then compressed with OptiPNG. The TIFFs for which this process is successful are deleted.
Please note that, by design, this script strips all TIFF and PNG metadata from the output files; however, file access and modification times are copied from the deleted TIFFs to the output PNGs.
This script runs only in Z shell (Zsh) and directly relies on the following utilities:
Starting with an argument of -h
, --help
, or -?
causes this message to be printed to stdout with no further actions.
- success
- optional directory argument not found
- process interrupted by SIGINT or SIGTERM
- failure in at least one file