Page 1 of 1

User Input Batch Input to Output Conversion

Posted: 2019-02-19T18:56:34-07:00
by ryanpcworld
I'm trying to use batch user input for entering the input directory where the images are stored so then you can enter the output directory where your converted files will be.

I tried this, it doesn't work:
SET /P INPUT=Please enter the input directory where your images are stored:
SET /P OUTPUT=Please enter the output directory where your images are going to be stored:
magick convert -path /%INPUT%/.bmp mogrify -dither FloydSteinberg -monochrome /%OUTPUT%/ *.bmp

-Input is outputting a monochrome .bmp to another directory.

Can anyone from the community help me fix the script? I appreciate your response!

Thanks! :D

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-19T19:18:14-07:00
by snibgo
What version of IM? I assume v7. On what platform? I assumes Windows BAT.

Your command is wrong. "magick convert" needs one input filename and one output filename, without wildcards . Your output filename contains a space. If you really want a space, you should quote the entire filename. But it won't work with a "*".

"mogrify" isn't a valid keyword in "magick convert".

If you want "mogrify", then use "magick mogrify" without "convert". But "mogrify" takes an input filename (with wildcard if you want) and no output filename.

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-19T20:29:58-07:00
by fmw42
If you are on IM 7, then the new syntax is just magick, not magick convert and not convert; otherwise you get IM 6 processing. For other tools such as identify, mogrify, montage, those must be prefaced with magick.

_________________________

Please, always provide your IM version and platform when asking questions, since syntax may differ.

Also provide your exact command line and your images, if possible.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620

If using Imagemagick 7, then see http://imagemagick.org/script/porting.php#cli


For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
https://github.com/ImageMagick/usage-markdown
https://imagemagick.org/script/porting.php#cli

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-19T21:00:57-07:00
by ryanpcworld
I'm trying to say is the batch file will tell you to enter the directory where your images are stored, then it will tell you which directory you want to save it in. That's what I'm trying to do, I'm using user input like this: http://inanecoding.co.uk/2011/06/simple ... tch-files/

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-19T21:01:20-07:00
by ryanpcworld
I'm also using IM7, I'm also a starter to this forum.

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-19T21:06:11-07:00
by ryanpcworld
Image

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-19T21:06:11-07:00
by ryanpcworld
Image

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-19T22:34:53-07:00
by snibgo
Your first error message is:

Code: Select all

'mogrify': No such file or directory
This is because
snibgo wrote:"mogrify" isn't a valid keyword in "magick convert".
As it isn't a keyword, IM supposes it must be an image file, so IM tries to find it, and fails.

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-19T23:02:59-07:00
by ryanpcworld
Image

Done it like this:
SET /P INPUT=Please enter the input directory where your images are stored:
SET /P OUTPUT=Please enter the output directory where your images are going to be stored:
@echo Converting...
magick convert -path /%INPUT%/.bmp -dither FloydSteinberg -monochrome /%OUTPUT%/ *.bmp

Now what?! It's giving me an "unrecognised option."

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-20T08:49:17-07:00
by snibgo
"-path" isn't a valid option for "magick convert". It is for "magick mogrify". I suggest you change "magick convert" to "magick mogrify".

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-20T10:10:26-07:00
by ryanpcworld
magick mogrify -path /%INPUT%/.bmp -dither FloydSteinberg -monochrome /%OUTPUT%/ *.bmp
Doesn't work.

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-20T10:18:48-07:00
by snibgo
ryanpcworld wrote:-path /%INPUT%/.bmp
The parameter should be a folder that exists. Do you have a folder that ends with the characters ".bmp"? If not, then remove those characters.

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-20T17:59:00-07:00
by ryanpcworld
I'm trying to say that I want to make a batch program that will convert images from a input directory to another directory.
At the start, it tells you to input where your bitmaps are stored then enter in the input, and then press enter and it will then ask you to then type in which directory where you want your converted files to be stored, continues on... Press enter and it will convert your bitmaps to monochrome in another folder. I tried your command btw doesn't work! :(

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-20T18:56:17-07:00
by snibgo
The documentation http://www.imagemagick.org/script/comma ... s.php#path says about "-path":
write images to this path on disk.
So this should be the directory for output, not input. And just the directory, without a filename.

Re: User Input Batch Input to Output Conversion

Posted: 2019-02-21T08:37:39-07:00
by ryanpcworld
Yes