Last active
December 21, 2021 18:09
-
-
Save seb776/24b1aafd699247973dbc89c7828789da to your computer and use it in GitHub Desktop.
Batch using imagemagick to assemble a Quilt for looking glass
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
@echo off | |
set quiltColumns=8 | |
set quiltRows=6 | |
set magickPath="magick.exe" | |
setlocal | |
set "psCommand="(new-object -COM 'Shell.Application')^ | |
.BrowseForFolder(0,'Please choose a folder.',0,0).self.path"" | |
for /f "usebackq delims=" %%I in (`powershell %psCommand%`) do set "folder=%%I" | |
setlocal enabledelayedexpansion | |
set outPath=!folder!\OutQuilt_%quiltColumns%x%quiltRows%.png | |
IF EXIST "%outPath%" ( | |
echo Found previous quilt at "%outPath%" | |
del "%outPath%" | |
) | |
set filesPath=!folder!\*.png | |
echo Your files for quilt "%filesPath%" | |
echo Your output quilt is "%outPath%" | |
echo: | |
echo Generating your quilt... | |
%magickPath% montage -flip -tile %quiltColumns%x%quiltRows% -geometry +0+0 -border 0 "%filesPath%" "%outPath%" | |
%magickPath% convert "%outPath%" -flip "%outPath%" | |
echo: | |
echo Quilt generated at %outPath% | |
endlocal | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment