Guest User

Untitled

a guest
Sep 18th, 2020
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. #!/bin/bash
  2. # mod_img.sh
  3. # Install dependencies: sudo apt install imagemagick
  4. # Usage: mod_img.sh inputfile outputfile
  5.  
  6. strength=30
  7.  
  8. blocksize=$(( RANDOM % 20 + 30 ))
  9. angle=$(( RANDOM % 90 ))
  10. scale=$(( 100 / blocksize ))
  11. str=$(( 100 - strength ))
  12. size=$(convert "$1" -format "%[w]x%[h]" info:)
  13.  
  14. echo Strength: $strength, Blocksize: $blocksize, Angle: $angle
  15. convert "$1" -scale $scale% +noise Poisson -scale $size -distort SRT $angle "$1" -compose Blend -define compose:args=$str -composite "$2"
  16.  
  17. #Stand alone command for reference
  18. # 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