@Gargron You mean, with a black or transparent box in the middle? You could use ImageMagick's mogrify command to draw it:
https://imagemagick.org/script/command-line-options.php#draw
If you want to remove a horizontal or vertical band in the middle, you could use -copy to move the bottom / rightmost rectangle next to the other one, then crop:
https://imagemagick.org/script/command-line-options.php#copy