Search code examples
windowsbatch-filecmdimagemagickimagemagick-convert

Batch Image Resizing / Scaling


I am trying to scale my images in .bat. For Example,

900
[  ] 600

I want to set the 900 pixel height to 400, then readjust the 600 to a percentage so it'll be a good quality and equal to the 900x600. I also want the batch file to automatically adjust the bigger size to be set as a pixel. Is this possible?

Whenever I try searching, I only find converting images through a batch through photoshop.


Solution

  • Not sure I really understand you question. Save this code as a .bat file then drag and drop your image over the batch file icon.

    convert "%1" -thumbnail 400x -unsharp 1.5x1.2+1.0+0.10 "%~p1resized_%~n1.jpg"