Image resizing via .bat file
-
- Posts: 6
- Joined: 2016-05-12T08:10:55-07:00
- Authentication code: 1151
Image resizing via .bat file
Hello everyone!
Can you help me with code, that will resize image to 1440*1440 px? Thanks!
Can you help me with code, that will resize image to 1440*1440 px? Thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image resizing via .bat file
What do you want to happen if the input image is not square? Imagemagick can force the output to be square, but that may distort the image if it was not originally square. So you need to decide if you want to crop or pad. See the sections below http://www.imagemagick.org/Usage/thumbnails/#creation.
Please always provide your IM version and platform? We assume you are on Windows if you mention .bat files.
Please read the very top-most post on this forum at viewtopic.php?f=1&t=9620 IMPORTANT: Please Read This FIRST Before Posting
Please always provide your IM version and platform? We assume you are on Windows if you mention .bat files.
Please read the very top-most post on this forum at viewtopic.php?f=1&t=9620 IMPORTANT: Please Read This FIRST Before Posting
-
- Posts: 6
- Joined: 2016-05-12T08:10:55-07:00
- Authentication code: 1151
Re: Image resizing via .bat file
All the time I gona have square images for resize.
I'm using "ImageMagick-7.0.1-Q16".
My platform is Windows.
I'm using "ImageMagick-7.0.1-Q16".
My platform is Windows.
-
- Posts: 6
- Joined: 2016-05-12T08:10:55-07:00
- Authentication code: 1151
Re: Image resizing via .bat file
All the time I gona have square images for resize.fmw42 wrote:What do you want to happen if the input image is not square? Imagemagick can force the output to be square, but that may distort the image if it was not originally square. So you need to decide if you want to crop or pad. See the sections below http://www.imagemagick.org/Usage/thumbnails/#creation.
Please always provide your IM version and platform? We assume you are on Windows if you mention .bat files.
Please read the very top-most post on this forum at viewtopic.php?f=1&t=9620 IMPORTANT: Please Read This FIRST Before Posting
I'm using "ImageMagick-7.0.1-Q16".
My platform is Windows.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image resizing via .bat file
The basic command is
If you want to resize all images in a folder, then
but that will overwrite your input images. So create a new empty directory and add -path path2/newdirectory to put the output in that directory. See http://www.imagemagick.org/Usage/basics/#mogrify
Sorry, I am not a Windows user and only script in unix bash shell.
Code: Select all
magick image -resize 1440x1440 result
Code: Select all
magick mogrify -resize 1440x1440 *
Sorry, I am not a Windows user and only script in unix bash shell.
-
- Posts: 6
- Joined: 2016-05-12T08:10:55-07:00
- Authentication code: 1151
Re: Image resizing via .bat file
It says to me that: "magick: unable to open image 'image': No such file or directory @ error/blob.c/OpenBlob/2691."fmw42 wrote:The basic command is
If you want to resize all images in a folder, thenCode: Select all
magick image -resize 1440x1440 result
but that will overwrite your input images. So create a new empty directory and add -path path2/newdirectory to put the output in that directory. See http://www.imagemagick.org/Usage/basics/#mogrifyCode: Select all
magick mogrify -resize 1440x1440 *
Sorry, I am not a Windows user and only script in unix bash shell.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image resizing via .bat file
You have to insert your own "image" path and filename there and specify your own "result" path and filename
For new users, see:
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/Usage/reference.html
and for windows users
http://www.imagemagick.org/Usage/windows/
For new users, see:
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/Usage/reference.html
and for windows users
http://www.imagemagick.org/Usage/windows/
-
- Posts: 6
- Joined: 2016-05-12T08:10:55-07:00
- Authentication code: 1151
Re: Image resizing via .bat file
Ah damn, thanksfmw42 wrote:You have to insert your own "image" path and filename there and specify your own "result" path and filename
One more question - is anyway to paste image on image? Thanks
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Image resizing via .bat file
If you want to overlay one image onto another, see
http://www.imagemagick.org/Usage/layers/
http://www.imagemagick.org/Usage/compose/
see
http://www.imagemagick.org/script/comma ... hp#gravity
http://www.imagemagick.org/script/comma ... p#geometry
See my links above also
http://www.imagemagick.org/Usage/layers/
http://www.imagemagick.org/Usage/compose/
Code: Select all
magick backgroundimage foregroundimage -gravity XX -geometry +X+Y -compose over -composite resultimage
http://www.imagemagick.org/script/comma ... hp#gravity
http://www.imagemagick.org/script/comma ... p#geometry
See my links above also
-
- Posts: 6
- Joined: 2016-05-12T08:10:55-07:00
- Authentication code: 1151
Re: Image resizing via .bat file
Thanks a lot!fmw42 wrote:If you want to overlay one image onto another, see
http://www.imagemagick.org/Usage/layers/
http://www.imagemagick.org/Usage/compose/
seeCode: Select all
magick backgroundimage foregroundimage -gravity XX -geometry +X+Y -compose over -composite resultimage
http://www.imagemagick.org/script/comma ... hp#gravity
http://www.imagemagick.org/script/comma ... p#geometry
See my links above also