Skip to content

Commit

Permalink
repository’s social media preview
Browse files Browse the repository at this point in the history
Images should be at least 640×320px (1280×640px for best display).
  • Loading branch information
kagurazakamasae authored Jul 10, 2021
1 parent 015a88b commit 4c9aaa8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions socialpreview.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash
fileName="socialpreview"
marginRight=150
fontFamily="思源黑体"
colorPink="245,169,184"
colorBlue="91,206,250"
colorWhite="255,255,255"
rm -f "${fileName}.png"
convert -size 2048x1024 xc:"rgb(${colorPink})" -fill "rgb(${colorBlue})" -draw "rectangle 2008,0 2048,2048" "${fileName}.bmp"
convert -draw "text ${marginRight},25 'Otokonoko'" -draw "text ${marginRight},200 'University'" -fill "rgb(${colorWhite})" -pointsize 140 -font "${fontFamily}-Bold" -gravity NorthEast "${fileName}.bmp" "${fileName}.bmp"
convert -draw "text ${marginRight},400 'Kagurazaka'" -fill "rgb(${colorWhite})" -pointsize 100 -style Italic -font "${fontFamily}-Light" -gravity NorthEast "${fileName}.bmp" "${fileName}.bmp"
convert "${fileName}.bmp" -resize 1280x640 "${fileName}.png"
rm -f "${fileName}.bmp"
unset fileName
unset marginRight
unset fontFamily
unset colorPink
unset colorBlue
unset colorWhite

0 comments on commit 4c9aaa8

Please sign in to comment.