targets=(2rings_BS.0020 2rings_BS.0045 2rings_normal_extension.0020 2rings_normal_extension.0045 2rings_wo_redistance.0020 2rings_wo_redistance.0045 2rings_twisted.0020 2rings_twisted.0045 2rings_ours.0020 2rings_ours.0045 2rings_0001 2rings_ours.0070 2rings_ours.0100 2rings_WP.0070 2rings_WP.0100 2rings.WP_sameDOF.0078 2rings.WP_sameDOF.0112 2rings_curvature_flow_big.0090 2rings_curvature_flow_big.0100 2rings_curvature_flow_big.0130 2rings_curvature_flow_big.0155)
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