Skip to content

Instantly share code, notes, and snippets.

@Adophilus
Created June 1, 2022 21:10
Show Gist options
  • Save Adophilus/60224ec0d2b7ac98eca7c1be8eab6902 to your computer and use it in GitHub Desktop.
Save Adophilus/60224ec0d2b7ac98eca7c1be8eab6902 to your computer and use it in GitHub Desktop.
batch script to flip all images in a folder
@echo off
setlocal EnableDelayedExpansion
mkdir split
mkdir flip
mkdir join
for %%h in ("*.png") do (
magick convert -crop "200x200" "%%h" "split\%%h"
cd split
for %%f in ("*.png") do (
ffmpeg -i "%%f" -vf hflip -c:a copy "..\flip\%%f"
)
cd ..
magick convert +append "flip\*" "join\%%h"
del /f /q "flip\*"
del /f /q "split\*"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment