Safe with original file name

If I have a set of images as input that I process one after the other with gmic, how can I safe them with the respective original filename in subfolder?

For a subfolder test/ :

$ gmic *.jpg blur 3 mirror x op test/

op stands for output_prefixed.

Thanks, that I should have found. Sorry for the inconvenience. By the way, the “test” subdir must exist in the example. It would actually be great if subdirectories were created in (any) output command in case they do not exist.