Lay one image to another in all subfolders and overwrite

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
DLC
Posts: 1
Joined: 2016-03-30T03:48:07-07:00
Authentication code: 1151

Lay one image to another in all subfolders and overwrite

Post by DLC »

Hi,
I have a huge problem to lay one image to another in all subfolders in main folder and overwrite the pictures. I'm begginer.

I use: Windows 8.1

I wrote something like this:
FOR %G IN ("*.jpg") DO composite netrelo_pl.png -gravity center "%G" "output\%G"

but the problem is that the program composited the pictures only in main catalogue and write it in "output" folder (not overwrite the images), what is obviousl.

How can I composite endless amount of pictures in main folder and subfolders with 1 image and overwrite all images (they have to have the same names)?
I'm a huge newbie. Thank you for help!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Lay one image to another in all subfolders and overwrite

Post by snibgo »

Your question seems to be about using the shell "for" command. See "help for", and particularly the "/R" option.

This may do what you want:

Code: Select all

FOR /R %G IN ("*.jpg") DO composite netrelo_pl.png -gravity center "%G" "%G
... but do a backup first!
snibgo's IM pages: im.snibgo.com
Post Reply