Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # mod_img.sh
- # Install dependencies: sudo apt install imagemagick
- # Usage: mod_img.sh inputfile outputfile
- strength=30
- blocksize=$(( RANDOM % 20 + 30 ))
- angle=$(( RANDOM % 90 ))
- scale=$(( 100 / blocksize ))
- str=$(( 100 - strength ))
- size=$(convert "$1" -format "%[w]x%[h]" info:)
- echo Strength: $strength, Blocksize: $blocksize, Angle: $angle
- convert "$1" -scale $scale% +noise Poisson -scale $size -distort SRT $angle "$1" -compose Blend -define compose:args=$str -composite "$2"
- #Stand alone command for reference
- # convert input.jpg -scale 5% +noise Poisson -scale 2000% input.jpg -compose Blend -define compose:args=85 -composite output.jpg
Add Comment
Please, Sign In to add comment