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

# Converts a linear-scale ppm file to a gamma-corrected PNG file 
# unsing the standard 6x6x6 colormap.

# Program paths:

# Option parsing:

scriptname="$0"
usagetail="[ < ] INFILE.ppm > OUTFILE.png "
source ${jslib}/linear-ppm-to-png-options.csh

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

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

exit 0
