Skip to content

Instantly share code, notes, and snippets.

@Drew3D
Created June 14, 2022 13:08
Show Gist options
  • Select an option

  • Save Drew3D/09d6efd8c2d75483f15108e651a5f597 to your computer and use it in GitHub Desktop.

Select an option

Save Drew3D/09d6efd8c2d75483f15108e651a5f597 to your computer and use it in GitHub Desktop.
Windows batch File for splitting MidJourney 2x2 .webp grid images into 4 separate PNG files using ffmpeg
for %%f in ("_RAW_GRIDS_WEBP/*.webp") do (
ffmpeg.exe -n -i "_RAW_GRIDS_WEBP/%%f" -vf "crop=iw/2:ih/2:0:0" "_SPLIT_GRIDS\%%~nf-01.png"
ffmpeg.exe -n -i "_RAW_GRIDS_WEBP/%%f" -vf "crop=iw/2:ih/2:iw/2:0" "_SPLIT_GRIDS\%%~nf-02.png"
ffmpeg.exe -n -i "_RAW_GRIDS_WEBP/%%f" -vf "crop=iw/2:ih/2:0:ih/2" "_SPLIT_GRIDS\%%~nf-03.png"
ffmpeg.exe -n -i "_RAW_GRIDS_WEBP/%%f" -vf "crop=iw/2:ih/2:iw/2:ih/2" "_SPLIT_GRIDS\%%~nf-04.png"
)
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment