Batch replace green-screen?
FFMPEG has colorkey and chromakey options, it does something likes
Overlay a greenscreen-video on top of a static background image

Using a shell script to loop through your thousand images on the ffmpeg command would be helpful.