The following simple batch file will loop through your 2x2 grids (in either .png or .webp formats) and split them into separate PNG file using the ffmpeg utility.
This batch file requires ffmpeg to be installed, and in your system PATH (or in the same directory as the batch file).
It works for any aspect ratio grid.
The 2x2 grids should be in a _RAW_GRIDS
directory.
The split grids will be copied to _SPLIT_GRIDS
as -01 -02 -03 -04 PNG files.
(See below for example setup)
(If you only have PNG grids you can get rid of the webp loop, but some old grids are in webp format.)
By default it won't overwrite any existing split grids if they already exist (the -n parameter to ffmpeg does this).
Save the following code into a file split-grids.bat
for %%f in ("_RAW_GRIDS/*.webp") do (
ffmpeg.exe -n -i "_RAW_GRIDS/%%f" -vf "crop=iw/2:ih/2:0:0" "_SPLIT_GRIDS\%%~nf-01.png"
ffmpeg.exe -n -i "_RAW_GRIDS/%%f" -vf "crop=iw/2:ih/2:iw/2:0" "_SPLIT_GRIDS\%%~nf-02.png"
ffmpeg.exe -n -i "_RAW_GRIDS/%%f" -vf "crop=iw/2:ih/2:0:ih/2" "_SPLIT_GRIDS\%%~nf-03.png"
ffmpeg.exe -n -i "_RAW_GRIDS/%%f" -vf "crop=iw/2:ih/2:iw/2:ih/2" "_SPLIT_GRIDS\%%~nf-04.png"
)
for %%f in ("_RAW_GRIDS/*.png") do (
ffmpeg.exe -n -i "_RAW_GRIDS/%%f" -vf "crop=iw/2:ih/2:0:0" "_SPLIT_GRIDS\%%~nf-01.png"
ffmpeg.exe -n -i "_RAW_GRIDS/%%f" -vf "crop=iw/2:ih/2:iw/2:0" "_SPLIT_GRIDS\%%~nf-02.png"
ffmpeg.exe -n -i "_RAW_GRIDS/%%f" -vf "crop=iw/2:ih/2:0:ih/2" "_SPLIT_GRIDS\%%~nf-03.png"
ffmpeg.exe -n -i "_RAW_GRIDS/%%f" -vf "crop=iw/2:ih/2:iw/2:ih/2" "_SPLIT_GRIDS\%%~nf-04.png"
)
pause
MidJourney Images\
split-grids.bat <--- the batch file you create
_RAW_GRIDS\ <--- directory of your grids
grid.png
...etc...
_SPLIT_GRIDS\ <--- split grids will be stored here
grid-01.png
grid-02.png
...etc...