Skip to content

Instantly share code, notes, and snippets.

@emcrisostomo
Last active August 29, 2015 14:05
Show Gist options
  • Save emcrisostomo/607ee2832353d1991c6d to your computer and use it in GitHub Desktop.
Save emcrisostomo/607ee2832353d1991c6d to your computer and use it in GitHub Desktop.
Resize the Flags Archive to the Desired Resolution
#!/bin/sh
# This script resizes all SVG files svg/*.svg to PNG files with the desired
# width. This script assumes that the following source and output directories
# already exist:
# * svg/
# * png/w
# for each target width w.
# Loop on the list of desired widths.
for res in 256 512
do
for i in svg/*.svg
do
IMAGE_NAME=$(basename $i .svg)
rsvg-convert -w ${res} $i -o png/${res}/${IMAGE_NAME}.png
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment