Skip to content

Instantly share code, notes, and snippets.

@vi
Created September 13, 2019 20:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vi/dc7a646c3f35a258e94bdcaec7476f0b to your computer and use it in GitHub Desktop.
Save vi/dc7a646c3f35a258e94bdcaec7476f0b to your computer and use it in GitHub Desktop.
Convert RGBA pictures to bigger grayscale picure showing colour planes and back using FFMpeg
#!/bin/bash
S=$(identify "$1" | cut -d' ' -f 3-3)
IFS=x SS=($S)
W=${SS[0]}
H=${SS[1]}
ffmpeg -v warning -i "$1" -pix_fmt yuva444p -f rawvideo - | ffmpeg -v warning -pix_fmt gray -s ${W}x$((H*4)) -f rawvideo -i - -y "$2"
#!/bin/bash
S=$(identify "$1" | cut -d' ' -f 3-3)
IFS=x SS=($S)
W=${SS[0]}
H=${SS[1]}
ffmpeg -v warning -i "$1" -pix_fmt gray -f rawvideo - | ffmpeg -v warning -pix_fmt yuva444p -s ${W}x$((H/4)) -f rawvideo -i - -y "$2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment