Last active
October 31, 2015 02:56
-
-
Save barrbrain/a708f6c4d28eec4680dd to your computer and use it in GitHub Desktop.
Calculate PSNR with CIE76 difference method
This file contains 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 | |
# REQUIRES imagemagick compiled with HDRI feature enabled | |
SIZE=$(head -n1 "$1" | sed -E 's/.*W([0-9]*) H([0-9]*).*/\1x\2/') | |
FMT="-size $SIZE -depth 8 -sampling-factor 4:2:0 -interlace plane -set colorspace Rec709YCbCr" | |
convert $FMT YUV:<(tail -n+3<"$1") YUV:<(tail -n+3<"$2") \ | |
-colorspace Lab -compose difference \ | |
-composite -evaluate Pow 2 -separate -evaluate-sequence Add \ | |
-filter box -resize 1x1\! -format "%[fx:-10*log(u)]\n" info: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment