Trying to batch but getting: "mogrify: unrecognized option"

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
twinbee

Trying to batch but getting: "mogrify: unrecognized option"

Post by twinbee »

Apparently one can't do many files at once (batch) with the convert tool, so mogrify is used instead. However, it comes up with this error when I try to batch drop shadow:

Code: Select all

mogrify  *.png ( +clone -background black -shadow 80x5+10+10 ) +swap  -background none  -layers merge +repage
The error is:
mogrify: unrecognized option `+clone' @ mogrify.c/MogrifyImageCommand/4307.

Surely there's a way to get round this?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Trying to batch but getting: "mogrify: unrecognized option"

Post by fmw42 »

I don't believe that you can use parenthesis processing or clones with mogrify. It is too old. To use parenthesis and clones, you need to use convert and a script to handle multiple images. I have tried the same in the past and received the same error. Parenthesis and clones were added to IM 6 and I believe that mogrify has its roots pre-IM 6.

I will defer to the IM folks for corrections to this statement or to any updates they decide to make on mogrify
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Trying to batch but getting: "mogrify: unrecognized option"

Post by magick »

You can use parens with mogrify however, +clone and -swap are not supported.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Trying to batch but getting: "mogrify: unrecognized option"

Post by anthony »

mogrify is limited to operations that process a single image. It is the only way it can handle looping over multiple images. this is why it does not allow the use of -clone -swap, or the direct use of -composition, as these all involve the use of an image sequence!

The other way is to use convert in a loop.
See IM Examples, Basics, Mogrify, Batch Processing Alternatives
http://www.imagemagick.org/Usage/basics/#mogrify_not


On proposal for IM v7 is to make mogrify a special type of looped 'convert' script. In whcih case mogrify will then handle all convert options. However this may require a syntax change to properly separate the 'image processing options' from list of images to loop over.

This is however only a proposal at this time as it also depends on a re-write of the way convert processes its options, to allow better scripting capabilities.
See http://www.imagemagick.org/Usage/bugs/I ... ations.txt
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
twinbee

Re: Trying to batch but getting: "mogrify: unrecognized option"

Post by twinbee »

Thanks all...
On proposal for IM v7 is to make mogrify a special type of looped 'convert' script. In whcih case mogrify will then handle all convert options. However this may require a syntax change to properly separate the 'image processing options' from list of images to loop over.
That would be great. It sounds as though it would unify mogrify into the main 'convert' script, and so no more updates to mogrify would ever be needed. Actually, would it really be all that tricky to add this functionality to 'convert' from afresh?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Trying to batch but getting: "mogrify: unrecognized option"

Post by fmw42 »

sounds to me more of an update or new version of mogrify rather than folding mogrify into convert.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Trying to batch but getting: "mogrify: unrecognized option"

Post by anthony »

Actually it requires a major overhaul of the "convert" program, it is a IM v7 proposal.
It will be a long time coming as we need someone with a lot of time to do the job.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply