Guest User

Untitled

a guest
Sep 18th, 2020
690
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. :: mod_img.bat
  2. :: Install dependencies: https://imagemagick.org/script/download.php#windows
  3. :: During install chack "Install legacy uitilities (eg convert)"
  4. :: Usage: mod_img.bat inputfile outputfile
  5. @echo off
  6. SET strength=30
  7.  
  8. SET /a blocksize=%RANDOM% %% 20 + 30
  9. SET /a angle=%RANDOM% %% 90
  10. SET /a scale=100/%blocksize%
  11. SET /a str=100-%strength%
  12. magick %1 -format %%wx%%h info: > tmp.txt
  13. SET /p size=<tmp.txt
  14. del tmp.txt
  15.  
  16. echo Strength %strength%, Blocksize: %blocksize%, Angle: %angle%, Scale: %scale%
  17. magick convert "%1" -scale %scale%%% +noise Poisson -scale %size% -distort SRT %angle% "%1" -compose Blend -define compose:args=%str% -composite "%2"
  18.  
  19. ::Stand alone command for reference
  20. :: 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