Page 1 of 1

Batch Edit

Posted: 2018-10-08T07:53:57-07:00
by digcollib
Hi--

I am trying to batch edit my files and save them as their original names using the code:

Code: Select all

 magick convert *.tif -colorspace gray -threshold 50% -compress Group4 -set filename:f %t "%[filename:f].tif"
But, they are all saved under the first tif name as almost a pdf, with all of the image combined into the one. Any tips on how to remedy this?

Re: Batch Edit

Posted: 2018-10-08T08:09:51-07:00
by snibgo
Use mogrify.

Re: Batch Edit

Posted: 2018-10-08T08:21:00-07:00
by digcollib
How does one use mogrify? I have never heard of this

Re: Batch Edit

Posted: 2018-10-08T08:31:07-07:00
by mattfack

Re: Batch Edit

Posted: 2018-10-08T08:31:51-07:00
by snibgo
For a list of ImageMagick tools, see http://www.imagemagick.org/script/comma ... -tools.php

For "magick mogrify" examples and options, see http://www.imagemagick.org/script/mogrify.php

Re: Batch Edit

Posted: 2018-10-08T08:46:40-07:00
by GeeMack
digcollib wrote: 2018-10-08T07:53:57-07:00I am trying to batch edit my files and save them as their original names using the code:

Code: Select all

 magick convert *.tif -colorspace gray -threshold 50% -compress Group4 -set filename:f %t "%[filename:f].tif"
But, they are all saved under the first tif name as almost a pdf, with all of the image combined into the one. Any tips on how to remedy this?
For your use the best answer is probably snibgo's suggestion to use "mogrify". But if you need to use "magick", you can make sure the output images are separate and not combined into a multi-image TIF by using the plus "+" version of +adjoin.

I would generally put that "-set filename ..." right after reading in the images. Also, I'd put quotes around the "%t" in case any of the file names have spaces or special characters in them.

When using IM7 you should probably be using just "magick" instead of "magick convert". Adding "convert" will make the command behave as if it's IM version 6. That's not usually what you'll want.