Skip to content

Instantly share code, notes, and snippets.

@incodemode
Last active September 15, 2019 22:18
Show Gist options
  • Save incodemode/20c46be2d895fc07c4482f52f54122ec to your computer and use it in GitHub Desktop.
Save incodemode/20c46be2d895fc07c4482f52f54122ec to your computer and use it in GitHub Desktop.
transform flags from https://github.com/lipis/flag-icon-css to a sprite of 20x13 with class fl-{countrycode} this is the size used by wikipedia
#download and unzip https://github.com/lipis/flag-icon-css
cd flags/4x3
mkdir result
convert *.svg -resize '20x13' -set filename:base "%[basename]" "%[filename:base].png"
glue-sprite -s ./ -o result/ --sprite-namespace "fl" --namespace ""
convert result/4x3.png -quality 50 result/4x3.jpg
sed "s|4x3.png|4x3.jpg|g" result/4x3.css
#img=$( base64 -w 0 result/4x3.jpg )
# result css and png are in flags/4x3/result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment