Batch convert jpegs to monochrome GIFs

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
pgON4ID
Posts: 3
Joined: 2014-07-31T04:54:10-07:00
Authentication code: 6789

Batch convert jpegs to monochrome GIFs

Post by pgON4ID »

Hi. What settings should I use to batch convert 300 jpegs to GIFs that have the following settings:

Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch convert jpegs to monochrome GIFs

Post by fmw42 »

try

Code: Select all

-colorspace gray +dither -colors 2 -auto-level
pgON4ID
Posts: 3
Joined: 2014-07-31T04:54:10-07:00
Authentication code: 6789

Re: Batch convert jpegs to monochrome GIFs

Post by pgON4ID »

I get nothing but garbage no matter what I try. Can't believe this.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch convert jpegs to monochrome GIFs

Post by fmw42 »

What version of IM and platform? If an old version of IM, you might consider upgrading.

What was your exact command line?

This worked fine for me on IM 6.8.9.6 Q16 Mac OSX

Code: Select all

convert rose: -colorspace gray +dither -colors 2 -auto-level rose_binary.gif
pgON4ID
Posts: 3
Joined: 2014-07-31T04:54:10-07:00
Authentication code: 6789

Re: Batch convert jpegs to monochrome GIFs

Post by pgON4ID »

Downloaded it for the first time today off of ImageMagick's website. Seems like nothing works. For example, while the two example codes in this article produce new images and don't give me any errors, the specified image modifications are not performed: http://www.ioncannon.net/linux/81/5-ima ... es-part-1/


And the example (convert –resize 800x800 *.jpg) in this nice introductory guide produces the following error:

Image


And as you can see, I need to move the images into ImageMagick's directory to get it to work at all, which is in contrast with the above tutorial as well as a youtube video I watched.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Batch convert jpegs to monochrome GIFs

Post by fmw42 »

convert –resize 800x800 *.jpg
Convert does not work this way. It requires one input and makes one output. If you want to process all files in a folder, then use mogrify.

Code: Select all

convert input -resize 800x800 output
or
cd to some directory, then

Code: Select all

mogrify -resize 800x800 *.jpg
But be careful, this will overwrite your image. If you do not want that, then create a new empty directory and use the -path option in mogrify.


see

http://www.imagemagick.org/script/convert.php
http://www.imagemagick.org/script/mogrify.php
http://www.imagemagick.org/Usage/basics/#syntax
http://www.imagemagick.org/Usage/basics/#mogrify

For new users, see
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/script/comma ... -tools.php
http://www.imagemagick.org/Usage/windows/
Post Reply