Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Resizing images into squares
#4
A bit of a struggle for me. Nothing I can see using BIMP and nothing using the usual GUI batch utilities such as XNViewMP.

So down to ImageMagick, which is a command line utility see: http://www.imagemagick.org and the Windows Installer download is way down bottom of this page https://www.imagemagick.org/script/download.php

This is the code to run in a terminal, copy and paste into notepad

Code:
for /r %x in (*.jpg) do magick "%x" -gravity Center -background White -extent "%[fx:max(w,h)]x%[fx:max(w,h)]" "%x_square.jpg"

and if you are not used to using Windows Command terminal some hints here:





Direct link https://youtu.be/qkdup-cReiA  duration 2 minutes

Not much I can do about the naming convention, maybe some Windows expert can advise or use one of the several Windows renaming utilities.

-----

EDIT: I did not think that the magick command could overwrite existing files, but it does. You could try the slightly amended command

Code:
for /r %x in (*.jpg) do magick "%x" -gravity Center -background White -extent "%[fx:max(w,h)]x%[fx:max(w,h)]" "%x"

That will keep the same file names.
Dangerous. Same as BIMP, work with copies or you might lose the originals.
Reply


Messages In This Thread
Resizing images into squares - by IAmFrenk - 02-09-2019, 03:28 PM
RE: Resizing images into squares - by rich2005 - 02-09-2019, 06:31 PM
RE: Resizing images into squares - by IAmFrenk - 02-11-2019, 12:10 AM
RE: Resizing images into squares - by rich2005 - 02-11-2019, 11:04 AM
RE: Resizing images into squares - by IAmFrenk - 02-11-2019, 09:05 PM
RE: Resizing images into squares - by salssal - 02-05-2021, 01:18 PM
RE: Resizing images into squares - by rich2005 - 02-05-2021, 03:22 PM
RE: Resizing images into squares - by salssal - 02-06-2021, 12:52 PM

Forum Jump: