Skip to content

Instantly share code, notes, and snippets.

@KennyStier
Last active May 26, 2017 18:39
Show Gist options
  • Save KennyStier/1b3aaf7ce596cf6a9160ed98b4e010c9 to your computer and use it in GitHub Desktop.
Save KennyStier/1b3aaf7ce596cf6a9160ed98b4e010c9 to your computer and use it in GitHub Desktop.
Rainier Automatic Raster Resizer
#!/bin/bash
#
# Written by Kenny Stier for Trenta.io
#
# Rainier Automatic Raster Resizer (RARR)
# Copyright (C) 2017 Trenta.io
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# To use, create app icons at 1024x1024 in the PNG format and
# place them in the apps/1024 directory. This script will
# use ImageMagick to resize the images and put them in their correct
# directories.
#
# Run this script in the apps/1024
# 512
mkdir -p ../512
rm -rf ../512/*
for file in ./*
do
convert "$file" -resize 512 "../512/$file"
done
# 256
mkdir -p ../256
rm -rf ../256/*
for file in ./*
do
convert "$file" -resize 256 "../256/$file"
done
# 128
mkdir -p ../128
rm -rf ../128/*
for file in ./*
do
convert "$file" -resize 128 "../128/$file"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment