Skip to content

Instantly share code, notes, and snippets.

@muhqu
Last active July 25, 2021 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muhqu/e280e4c9434261cf2a32 to your computer and use it in GitHub Desktop.
Save muhqu/e280e4c9434261cf2a32 to your computer and use it in GitHub Desktop.
Extract AWS Service Icons from sprite
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2015 Mathias Leppich <mleppich@muhqu.de>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
set -e
curl -s https://d34xub3ut0ooib.cloudfront.net/img/sprite.74912210ecce3b8cc2a8e53158f698f1.png > sprite.png
services=(ec2 emr storagegateway s3 dynamodb elasticache rds vpc route53 \
ses sns sqs swf cloudfront iam cloudwatch cloudformation elasticbeanstalk \
cloudsearch directconnect glacier datapipeline elastictranscoder redshift \
opsworks cloudtrail appstream workspaces kinesis zocalo cognito mobileanalytics \
trustedadvisor directoryservice codedeploy config lambda workmail \
machinelearning ecs efs devicefarm apigateway catalog codepipeline codecommit)
mkdir -p ./aws-icons-{24,20,16,32}
for i in $(seq 0 $(( ${#services[@]} - 1))); do
convert -verbose sprite.png -crop 24x24+$(( 32*$i ))+0 ./aws-icons-24/aws-${services[$i]}-24.png;
done
for i in $(seq 0 $(( ${#services[@]} - 1))); do
convert -verbose sprite.png -crop 20x20+$(( 32*$i ))+24 ./aws-icons-20/aws-${services[$i]}-20.png;
done
for i in $(seq 0 $(( ${#services[@]} - 1))); do
convert -verbose sprite.png -crop 16x16+$(( 32*$i ))+44 ./aws-icons-16/aws-${services[$i]}-16.png;
done
for i in $(seq 0 $(( ${#services[@]} - 1))); do
convert -verbose sprite.png -crop 32x31+$(( 32*$i ))+60 \
-gravity center -background transparent -extent 32x32 \
./aws-icons-32/aws-${services[$i]}-32.png;
done
@rtlong
Copy link

rtlong commented Jul 31, 2015

This is cool. Amazon does provide a set of SVG/EPS icons, in case anyone is looking for higher quality icons https://aws.amazon.com/architecture/icons/

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