targets=(trefoil_low_res_vert.0125 trefoil_low_res.0125 trefoil_normal_res_vert.0125 trefoil_normal_res.0125 trefoil.0001 trefoil_WP.0125 trefoil_WP.0150 trefoil_ours.0125 trefoil_ours.0150)
color=white
for target in ${targets[@]}
do
    echo "convert $target.png to $target.jpg"
    
    # convert $target.png -background $color -flatten -alpha off $target.jpg

    ffmpeg -y -i $target$j.png -filter_complex "color=white,format=rgb24[c];[c][0]scale2ref[c][i];[c][i]overlay=format=auto:shortest=1,setsar=1" ${target}W$j.png
    convert ${target}W$j.png ${target}.jpg
done