Skip to content

Instantly share code, notes, and snippets.

@Adophilus
Last active June 1, 2022 21:11
Show Gist options
  • Save Adophilus/2cdd477470b11c7a9eaa6114c3564f9a to your computer and use it in GitHub Desktop.
Save Adophilus/2cdd477470b11c7a9eaa6114c3564f9a to your computer and use it in GitHub Desktop.
a list of snippets for manipulating image data
rem ffmpeg
rem flip an image on the x (horizontal axis)
for %%f in (*.png) do ffmpeg -i "%%f" -vf hflip -c:a copy "Flip-%%f"
rem flip an image on the y (vertical axis)
for %%f in (*.png) do ffmpeg -i "%%f" -vf vflip -c:a copy "Flip-%%f"
rem imagemagick
rem split an image in to n wxh parts
rem n here will be automatically determined
magick convert -crop 200x200 input.png output.png
rem concatenate images into one (horizontally)
magick convert +append "input-*.png" "output.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment