0
votes

hello if anyone want to help with this it would be great. the below command is working

mogrify -verbose -path /cygdrive/L/temp/og-rotate-logo -format jpg -draw 'image over 0,0 0,0 "/cygdrive/L/temp/logo.png"' -gravity southeast *.jpg -path /cygdrive/L/temp/1200px -adaptive-resize 1200x1200 *.jpg

however it seems a little ugly in that it first makes all the logo images and then works on all the resizing of those images.

my question is there a better or faster way to do this? i'm working with thousands of photos at a time.

any help is much appreciated

also fyi i'm running windows 7 with cygwin and imagemagick

1

1 Answers

0
votes

Mmmm... a few thoughts:

  • Your -format jpg is superfluous as your input files are already JPEGs

  • You have repeated *.jpg in your command, that is not correct - you only need it once

So, try something more like this:

mogrify -gravity southeast -path /cygdrive/L/temp/og-rotate-logo ^
   -draw 'image over 0,0 0,0 "/cygdrive/L/temp/logo.png"'        ^
   -adaptive-resize 1200x1200 *.jpg

I don't use Windows, but I believe the ^ is the line continuation character above.

To answer your actual question, I would recommend installing GNU Parallel if you have thousands of images to deal with, though I have never used it on Windows.

dir /b *.jpg | parallel -X mogrify -gravity southeast -path /cygdrive/L/temp/og-rotate-logo -draw 'image over 0,0 0,0 "/cygdrive/L/temp/logo.png"' -adaptive-resize 1200x1200 

You may also gain some performance by re-saving your logo.png (just one time) as an MPC file and then using that in your mogrify:

convert /cygdrive/L/temp/logo.png /cygdrive/L/temp/logo.mpc

then use:

mogrify -gravity southeast -path /cygdrive/L/temp/og-rotate-logo ^
  -draw 'image over 0,0 0,0 "/cygdrive/L/temp/logo.mpc"'        ^
  -adaptive-resize 1200x1200 *.jpg

Please make a copy of a few files in a separate testing directory and just work on them until you get more experienced with GNU Parallel and mogrify - it can make a very big mess, very fast, in parallel.