fx_morph_layers batch outputs

I’m trying to morph a series of images, e.g., image1 with image2, image2 with image3 etc, using the fx_morph_layers filter.
How can I batch the process so the outputs are numbered sequentially? For example, running gmic image_00000.jpg image_00001.jpg fx_morph_layers 5,1.2,0.57 o out.jpg - gives outputs from ‘out_000000.jpg’ to ’
‘out_000006.jpg’. If we were to run the next command, gmic image_00001.jpg image_00002.jpg fx_morph_layers 5,1.2,0.57 o out.jpg - gmic overwrites the previous outputs. I need continuous numbering across commands. Any advice?

Furthermore, if I try the apply files route, say gmic apply_files \"input_*.png input_*(+1).png\",\"fx_morph_layers 12,0.4,0.25,0\",0,-1,1,out.png I’d be barking up the wrong tree. Or for instance (with separate image sequences) - gmic apply_files \"input_*.png image2_*.png\",\"fx_morph_layers 12,0.4,0.25,0\",0,-1,1,out.png - that simply doesn’t work and anyhow i would want it to alternate between sequences - so a bit stuck. I could knock up a batch file to do each command for separate image pairs, somehow renaming them along the way so they don’t conflict, but that’s beyond my ken unfortunately… and don’t get me started on ChatGPT. :face_with_symbols_over_mouth: Lol.

You probay want to wrap this in a shell script so you can manipulate the file names.

I guess you could try to make a command to name those images all at once before exporting. Too occupied with my things for now.

Pinging @David_Tschumperle as he can help more I think.

I have been incredibly busy myself.

Tips:

  1. Use gmic run "commands" to avoid having to escape everything in one-liners.
  2. No need to do a shell script. Create a custom commands within an user.gmic or *.gmic file. By now @Mushy, you should start exploring that. As much as I love one liners, they are not good for complex lines of code or processing.
  3. Building on #2, I like the user.gmic approach because I can make simple yet effective helper commands, such as changing image names.

I have not told you how exactly to do all this, but a planned approach saves time and from head scratching.