User Input Batch Input to Output Conversion
-
- Posts: 9
- Joined: 2019-02-19T18:49:31-07:00
- Authentication code: 1152
User Input Batch Input to Output Conversion
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!
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!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: User Input Batch Input to Output Conversion
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.
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.
snibgo's IM pages: im.snibgo.com
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: User Input Batch Input to Output Conversion
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
_________________________
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
-
- Posts: 9
- Joined: 2019-02-19T18:49:31-07:00
- Authentication code: 1152
Re: User Input Batch Input to Output Conversion
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/
-
- Posts: 9
- Joined: 2019-02-19T18:49:31-07:00
- Authentication code: 1152
Re: User Input Batch Input to Output Conversion
I'm also using IM7, I'm also a starter to this forum.
-
- Posts: 9
- Joined: 2019-02-19T18:49:31-07:00
- Authentication code: 1152
-
- Posts: 9
- Joined: 2019-02-19T18:49:31-07:00
- Authentication code: 1152
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: User Input Batch Input to Output Conversion
Your first error message is:
This is because
Code: Select all
'mogrify': No such file or directory
As it isn't a keyword, IM supposes it must be an image file, so IM tries to find it, and fails.snibgo wrote:"mogrify" isn't a valid keyword in "magick convert".
snibgo's IM pages: im.snibgo.com
-
- Posts: 9
- Joined: 2019-02-19T18:49:31-07:00
- Authentication code: 1152
Re: User Input Batch Input to Output Conversion
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."
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: User Input Batch Input to Output Conversion
"-path" isn't a valid option for "magick convert". It is for "magick mogrify". I suggest you change "magick convert" to "magick mogrify".
snibgo's IM pages: im.snibgo.com
-
- Posts: 9
- Joined: 2019-02-19T18:49:31-07:00
- Authentication code: 1152
Re: User Input Batch Input to Output Conversion
magick mogrify -path /%INPUT%/.bmp -dither FloydSteinberg -monochrome /%OUTPUT%/ *.bmp
Doesn't work.
Doesn't work.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: User Input Batch Input to Output Conversion
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.ryanpcworld wrote:-path /%INPUT%/.bmp
snibgo's IM pages: im.snibgo.com
-
- Posts: 9
- Joined: 2019-02-19T18:49:31-07:00
- Authentication code: 1152
Re: User Input Batch Input to Output Conversion
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!
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!
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: User Input Batch Input to Output Conversion
The documentation http://www.imagemagick.org/script/comma ... s.php#path says about "-path":
So this should be the directory for output, not input. And just the directory, without a filename.write images to this path on disk.
snibgo's IM pages: im.snibgo.com
-
- Posts: 9
- Joined: 2019-02-19T18:49:31-07:00
- Authentication code: 1152