ffmpeg has a feature to overlay image on top of the video with fade-in and fade-out. It also able to combine with alpha value, so its interaction could be more smoother.
ffmpeg -f lavfi -i color=color=black -loop 1 -i logo.png -filter_complex "\ [1:0] format=rgba,fade=in:st=0:d=3:alpha=1,fade=out:st=6:d=3:alpha=1 [ovr];\ [0:0][ovr] overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2\ " -t 10 -y out.gif