4x4 Image Montage Generator for Windows DOS
Posted: 2011-04-11T15:42:18-07:00
New to the forum gotta say "WOW" amazing program and I was having fun with some old dos tricks and I thought I should share this one. (Dunno if this is the right Message Board to post this in please move the Subject should it not be in the right place).
This script as it is will create a dos batch file with a binary concept for making 4x4 image grids (I use it to make masks using this script and scale 2x and I get amazing results)
What you need to build is 2 images 0.png and 1.png (They can be 1 pixel or any size you wish) using this method you literaly make all the possible combo's of every possibility of a 4x4 grid (about 65k in total images)
(Save what is in beetween the dotted line in a file called 4x4_Montage.bat)
@echo off
set A=0
set B=0
set C=0
set D=0
set E=0
set F=0
set G=0
set H=0
Set I=0
Set J=0
Set K=0
Set L=0
Set M=0
Set N=0
Set O=0
Set P=0
:loop
echo montage %P%.png %O%.png %N%.png %M%.png %L%.png %K%.png %J%.png %I%.png %H%.png %G%.png %F%.png %E%.png %D%.png %C%.png %B%.png %A%.png -mode Concatenate -tile 4x4 4x4_%P%%O%%N%%M%%L%%K%%J%%I%%H%%G%%F%%E%%D%%C%%B%%A%.png >>list(4x4).bat
echo %P%%O%%N%%M%%L%%K%%J%%I%%H%%G%%F%%E%%D%%C%%B%%A%
if %A%==1 (goto addB) ELSE set /A A+=1 & goto loop
:addB
set /A A=0 & if %B%==1 (goto addC) ELSE set /A B+=1 & goto loop
:addC
set /A B=0 & if %C%==1 (goto addD) ELSE set /A C+=1 & goto loop
:addD
set /A C=0 & If %D%==1 (goto addE) ELSE set /A D+=1 & goto loop
:addE
set /A D=0 & if %E%==1 (goto addF) ELSE set /A E+=1 & goto loop
:addF
set /A E=0 & if %F%==1 (goto addG) ELSE set /A F+=1 & goto loop
:addG
set /A F=0 & if %G%==1 (goto addH) ELSE set /A G+=1 & goto loop
:addH
set /A G=0 & if %H%==1 (goto addI) ELSE set /A H+=1 & Goto loop
:addI
set /A H=0 & if %I%==1 (goto addJ) ELSE set /A I+=1 & goto loop
:addJ
set /A I=0 & if %J%==1 (goto addK) ELSE set /A J+=1 & goto loop
:addK
set /A J=0 & if %K%==1 (goto addL) ELSE set /A K+=1 & goto loop
:addL
set /A K=0 & if %L%==1 (goto addM) ELSE set /A L+=1 & goto loop
:addM
set /A L=0 & if %M%==1 (goto addN) ELSE Set /A M+=1 & goto loop
:addN
set /A M=0 & if %N%==1 (goto addO) ELSE set /A N+=1 & goto loop
:addO
set /A N=0 & if %O%==1 (goto addP) ELSE set /A O+=1 & goto loop
:addP
set /A O=0 & if %P%==1 (goto EndLoop) ELSE set /A P+=1 & goto loop
:EndLoop
Pause
-----------------
This code works on any NT Version of windows...
Have fun with it .. And have a great day everyone..
P.S: Should anyone can make this in a powershell or figure out to reduce it more (I'd love to make a 16x16 grid generator but 256 variables is just too mind boggling)
Shawn W. D.
aka PandoraBox
This script as it is will create a dos batch file with a binary concept for making 4x4 image grids (I use it to make masks using this script and scale 2x and I get amazing results)
What you need to build is 2 images 0.png and 1.png (They can be 1 pixel or any size you wish) using this method you literaly make all the possible combo's of every possibility of a 4x4 grid (about 65k in total images)
(Save what is in beetween the dotted line in a file called 4x4_Montage.bat)
@echo off
set A=0
set B=0
set C=0
set D=0
set E=0
set F=0
set G=0
set H=0
Set I=0
Set J=0
Set K=0
Set L=0
Set M=0
Set N=0
Set O=0
Set P=0
:loop
echo montage %P%.png %O%.png %N%.png %M%.png %L%.png %K%.png %J%.png %I%.png %H%.png %G%.png %F%.png %E%.png %D%.png %C%.png %B%.png %A%.png -mode Concatenate -tile 4x4 4x4_%P%%O%%N%%M%%L%%K%%J%%I%%H%%G%%F%%E%%D%%C%%B%%A%.png >>list(4x4).bat
echo %P%%O%%N%%M%%L%%K%%J%%I%%H%%G%%F%%E%%D%%C%%B%%A%
if %A%==1 (goto addB) ELSE set /A A+=1 & goto loop
:addB
set /A A=0 & if %B%==1 (goto addC) ELSE set /A B+=1 & goto loop
:addC
set /A B=0 & if %C%==1 (goto addD) ELSE set /A C+=1 & goto loop
:addD
set /A C=0 & If %D%==1 (goto addE) ELSE set /A D+=1 & goto loop
:addE
set /A D=0 & if %E%==1 (goto addF) ELSE set /A E+=1 & goto loop
:addF
set /A E=0 & if %F%==1 (goto addG) ELSE set /A F+=1 & goto loop
:addG
set /A F=0 & if %G%==1 (goto addH) ELSE set /A G+=1 & goto loop
:addH
set /A G=0 & if %H%==1 (goto addI) ELSE set /A H+=1 & Goto loop
:addI
set /A H=0 & if %I%==1 (goto addJ) ELSE set /A I+=1 & goto loop
:addJ
set /A I=0 & if %J%==1 (goto addK) ELSE set /A J+=1 & goto loop
:addK
set /A J=0 & if %K%==1 (goto addL) ELSE set /A K+=1 & goto loop
:addL
set /A K=0 & if %L%==1 (goto addM) ELSE set /A L+=1 & goto loop
:addM
set /A L=0 & if %M%==1 (goto addN) ELSE Set /A M+=1 & goto loop
:addN
set /A M=0 & if %N%==1 (goto addO) ELSE set /A N+=1 & goto loop
:addO
set /A N=0 & if %O%==1 (goto addP) ELSE set /A O+=1 & goto loop
:addP
set /A O=0 & if %P%==1 (goto EndLoop) ELSE set /A P+=1 & goto loop
:EndLoop
Pause
-----------------
This code works on any NT Version of windows...
Have fun with it .. And have a great day everyone..
P.S: Should anyone can make this in a powershell or figure out to reduce it more (I'd love to make a 16x16 grid generator but 256 variables is just too mind boggling)
Shawn W. D.
aka PandoraBox