Created
January 31, 2012 03:56
-
-
Save sergiolopes/1708679 to your computer and use it in GitHub Desktop.
Shows lossy compression of a JPEG file. It just rotates an image 180 degrees a couple times. Using 100% quality it's still a lossy format.
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 | |
# Params: | |
# - original filename | |
# - number of 180 degrees rotations | |
cp $1 degradated.jpg | |
for ((i=1; i <= $2 ; i++)); do | |
convert degradated.jpg -quality 100 -rotate 180 temp.jpg | |
mv temp.jpg degradated.jpg | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment