Created
May 3, 2020 07:55
-
-
Save heitara/962a1d19f00550d2067142718984a298 to your computer and use it in GitHub Desktop.
Image Magick resize and manipulate files on Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM add watermark to all JPG images in the same folder | |
REM resize all JPG images in the same folder | |
REM put the result in different folder | |
SET IMAGE_MAGICK="C:\Program Files\ImageMagick-7.0.10-Q16\magick.exe" | |
SET SIZE=700x700 | |
mkdir watermark | |
mkdir resize | |
for /F "usebackq delims=" %%i in (`dir /a:-d /b %foldername%\*.jpg`) do %IMAGE_MAGICK% %%i ( watermark.png ) -gravity center -composite watermark\%%i | |
for /F "usebackq delims=" %%i in (`dir /a:-d /b %foldername%\*.jpg`) do %IMAGE_MAGICK% %%i -resize "%SIZE%\>" resize\%%i | |
rem %IMAGE_MAGICK% lab.jpg ( watermark.png ) -gravity center -composite ouput.jpg | |
rem %IMAGE_MAGICK% lab.jpg -resize "%SIZE%\>" ouput_pab.jpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment