Keep in mind that scripting is now decades old. It's a basic staple when we need to automate work like this. So you have your script or batch files, then tools to change/edit images from the command line like Image Magick and others.

Given how many decades command line use has been around, you know it can be done this way.