Created
September 13, 2019 20:39
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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