Bulk process of mogrify command

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
karkovo
Posts: 2
Joined: 2016-07-08T05:00:51-07:00
Authentication code: 1151

Bulk process of mogrify command

Post by karkovo »

I have a folder with these images:
test_0.png
test_1.png
test_2.png
test_3.png
test_4.png
...

This command works fine for one image.

Code: Select all

mogrify -gravity center -background white -extent 200x200 -draw 'image Dst_Over 0,0 0,0 "test_0.png"' *.png
My problem is that I need to run this command for all images, so I want a bulk process of all images in that directory without the need of specify the image.

How can I do that? thanks
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Bulk process of mogrify command

Post by snibgo »

I don't know what you are trying to do. Perhaps you want to paste test_0.png over each image (including itself) in turn.

I suggest you use "convert" instead of "mogrify". This will operate on one image at a time. Then put that in a shell "for" loop.
snibgo's IM pages: im.snibgo.com
karkovo
Posts: 2
Joined: 2016-07-08T05:00:51-07:00
Authentication code: 1151

Re: Bulk process of mogrify command

Post by karkovo »

snibgo wrote:I don't know what you are trying to do. Perhaps you want to paste test_0.png over each image (including itself) in turn.

I suggest you use "convert" instead of "mogrify". This will operate on one image at a time. Then put that in a shell "for" loop.
Just to clarify.

-I have a folder with images (140x108)
-I need to extend each image to the size of 200x200, by filling with white the background

Well aparenlty this works fine:

Code: Select all

mogrify -gravity center -background white -extent 200x200  *.png
thanks
Post Reply