Skip to content

Instantly share code, notes, and snippets.

@mohsin
Created September 30, 2020 11:46
Show Gist options
  • Save mohsin/aba05f794703a1a09d793fd6fdc1d935 to your computer and use it in GitHub Desktop.
Save mohsin/aba05f794703a1a09d793fd6fdc1d935 to your computer and use it in GitHub Desktop.
Ionic IOS Splash Screen Generator script
#!/bin/bash -e
# Check if ImageMagick is installed
command -v convert >/dev/null 2>&1 || { echo >&2 "Requires imagemagick, but it's not installed. See http://www.imagemagick.org. Aborting."; exit 1; }
# Use the largest images as the base for generating the others
portrait="portrait.png"
landscape="landscape.png"
convert $portrait -resize 640x1136 -gravity center -background white -extent 640x1136 Default-568h@2x~iphone.png
convert $portrait -resize 750x1334 -gravity center -background white -extent 750x1334 Default-667h.png
convert $portrait -resize 1242x2208 -gravity center -background white -extent 1242x2208 Default-736h.png
convert $portrait -resize 828x1792 -gravity center -background white -extent 828x1792 Default-1792h~iphone.png
convert $portrait -resize 1125x2436 -gravity center -background white -extent 1125x2436 Default-2436h.png
convert $portrait -resize 1242x2688 -gravity center -background white -extent 1242x2688 Default-2688h~iphone.png
convert $landscape -resize 2208x1242 -gravity center -background white -extent 2208x1242 Default-Landscape-736h.png
convert $landscape -resize 1792x828 -gravity center -background white -extent 1792x828 Default-Landscape-1792h~iphone.png
convert $landscape -resize 2436x1125 -gravity center -background white -extent 2436x1125 Default-Landscape-2436h.png
convert $landscape -resize 2688x1242 -gravity center -background white -extent 2688x1242 Default-Landscape-2688h~iphone.png
convert $landscape -resize 2732x2048 -gravity center -background white -extent 2732x2048 Default-Landscape@~ipadpro.png
convert $landscape -resize 2048x1536 -gravity center -background white -extent 2048x1536 Default-Landscape@2x~ipad.png
convert $landscape -resize 1024x768 -gravity center -background white -extent 1024x768 Default-Landscape~ipad.png
convert $portrait -resize 2048x2732 -gravity center -background white -extent 2048x2732 Default-Portrait@~ipadpro.png
convert $portrait -resize 1536x2048 -gravity center -background white -extent 1536x2048 Default-Portrait@2x~ipad.png
convert $portrait -resize 768x1024 -gravity center -background white -extent 768x1024 Default-Portrait~ipad.png
convert $portrait -resize 640x960 -gravity center -background white -extent 640x960 Default@2x~iphone.png
convert $portrait -resize 2732x2732 -gravity center -background white -extent 2732x2732 Default@2x~universal~anyany.png
convert $portrait -resize 320x480 -gravity center -background white -extent 320x480 Default~iphone.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment