Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. $ ruby -e '[10,100,200].each { |x| `inkscape --export-png logo#{x}.png -w #{x} logo.svg` }'
  2.  
  3. for x in 10 100 200 ; do inkscape --export-png logo${x}.png -w ${x} logo.svg ; done
  4.  
  5. #!/bin/sh
  6. # Converts the Inkscape icon file ic_launcher_web.svg to the launcher web & app png files.
  7.  
  8. PROJECT="My Project Name"
  9. INPUT="source-assets/ic_launcher_web.svg"
  10. MAIN="${PROJECT}/src/main/"
  11. RES="${MAIN}res/"
  12. DRAWABLE="${RES}/drawable"
  13.  
  14. inkscape --shell <<COMMANDS
  15. --export-png "${MAIN}ic_launcher-web.png" -w 512 "${INPUT}"
  16. --export-png "${DRAWABLE}-mdpi/ic_launcher.png" -w 48 "${INPUT}"
  17. --export-png "${DRAWABLE}-hdpi/ic_launcher.png" -w 72 "${INPUT}"
  18. --export-png "${DRAWABLE}-xhdpi/ic_launcher.png" -w 96 "${INPUT}"
  19. --export-png "${DRAWABLE}-xxhdpi/ic_launcher.png" -w 144 "${INPUT}"
  20. quit
  21. COMMANDS
  22.  
  23. brew install imagemagick --with-librsvg
  24.  
  25. brew install homebrew/gui/inkscape
  26.  
  27. convert -density 1536 -background none -resize 100x100 input.svg output-100.png
  28.  
  29. for s in 10 100 200 ; do convert -density 1536 -background none -resize ${s}x${s} input.svg output-${s}.png ; done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement