Image resizing via .bat file
Posted: 2016-05-12T08:14:09-07:00
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!
Use https://github.com/ImageMagick/ImageMagick/discussions instead.
https://imagemagick.com/discourse-server/
https://imagemagick.com/discourse-server/viewtopic.php?t=29673
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
Code: Select all
magick image -resize 1440x1440 result
Code: Select all
magick mogrify -resize 1440x1440 *
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.
Ah damn, thanksfmw42 wrote:You have to insert your own "image" path and filename there and specify your own "result" path and filename
Code: Select all
magick backgroundimage foregroundimage -gravity XX -geometry +X+Y -compose over -composite resultimage
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