Skip to content

Instantly share code, notes, and snippets.

@AlexKMDev
Last active August 29, 2015 14:24
Show Gist options
  • Save AlexKMDev/dfe43ecc87ff3171309b to your computer and use it in GitHub Desktop.
Save AlexKMDev/dfe43ecc87ff3171309b to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ -z "$3" ]
then
echo "usage: $0 background.png lgbt.svg output.png"
exit 1
fi
bg_size=$(identify -format '%wx%h' "$1")
convert -resize $bg_size\! $2 -density 1200 -alpha set -channel A -evaluate set 40% $2.png
convert -composite "$1" "$2.png" -geometry $bg_size+0+0 -depth 8 "$3"
rm $2.png
Display the source blob
Display the rendered blob
Raw
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" width="777" height="480">
<rect fill="#750787" height="480" width="777"/>
<rect fill="#004DFF" height="400" width="777"/>
<rect fill="#008026" height="320" width="777"/>
<rect fill="#FFED00" height="240" width="777"/>
<rect fill="#FF8C00" height="160" width="777"/>
<rect fill="#E40303" height="80" width="777"/>
</svg>
@imevro
Copy link

imevro commented Jul 3, 2015

foreground.svg → lgbt.svg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment