#!/bin/sh -e

for i in `ls *.ppg` ; do
    if [ -L "$i" ] ; then
	continue
    fi
    cp "$i" "$i"~
    JPG=`basename "$i" .ppg`.jpg
    mv "$i" "$JPG"
    denoise "$JPG"
    rm -f "${JPG}"~
    mv "$JPG" "$i"
done
