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 | |
# brew install oath-toolkit | |
# | |
# ~/.otpkeys: | |
# name1=secret | |
# name2=secret | |
scriptname=`basename $0` | |
if [ -z $1 ] |
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
import cStringIO | |
import PIL.Image | |
from ssim import compute_ssim | |
def get_ssim_at_quality(photo, quality): | |
"""Return the ssim for this JPEG image saved at the specified quality""" | |
ssim_photo = cStringIO.StringIO() | |
# optimize is omitted here as it doesn't affect | |
# quality but requires additional memory and cpu |