One can script both photoshop and gimp. I spent a year and a half writing scripts against Photoshop and gimp has a batch mode in a CLI.
One used to be able to record a macro in Photoshop and export it to a script that one could call from a visual studio project. The code it produced was barely human readable but it was helpful for discovery.
"Muscle memory" I worked years ago as a welders assistant and the physical act of controlling the trigger on a burning torch became ingrained and reflexive. It really does apply to everything even table saws.
One used to be able to record a macro in Photoshop and export it to a script that one could call from a visual studio project. The code it produced was barely human readable but it was helpful for discovery.