#! /bin/bash
# Last edited on 2024-04-01 16:53:10 by stolfi

# Converts a linear-scale ppm file to a gamma-corrected, normalized,
# grayscale PNG file, using the gray subset of the standard 6x6x6 colormap.

# Set program paths:

# Option parsing:

scriptname="$0"
usagetail="[ < ] INFILE.ppm > OUTFILE.png "
source ${STOLFIHOME}/lib/linear_ppm_to_png_options.sh

if [[ $# -gt 1 ]]; then
  echo "usage: ${usage}" 1>&2; exit 1
fi

( ${getimg} $* ; yes ) \
  | convert ${infile} -gamma ${gamma} PNG:-

exit 0
