#!/bin/sh for f in *.png; do out_file="${f%.*}.gif" if [ ! -f "$out_file" ]; then magick "$f" -background white -flatten -transparent white "$out_file" fi done