Update: With the assets command of the TiCons CLI / Module this can be done even simpeler by calling $ ticons assets
or an alloy.ymk
using:
1 2 3 |
task("pre:load", function(event, logger) { require('ticons').assets(); }); |
With all these different pixel densities, you can spend a good deal of time resizing images. For iOS, this means downsizing your retina @2x
images by 50%. I wrote a little NodeJS script to use in an alloy.jmk
or Alloy Build Configuration File that automatically generates non-retina images by using ImageMagick on new and changed retina ones.
Get the script at Github:
https://gist.github.com/FokkeZB/6095822
How to use
- Open terminal
- Install Homebrew
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
- Install ImageMagick
brew install imagemagick
- Install the ImageMagick NodeJS module
sudo npm install -g imagemagick
- Copy the alloy.jmk to your Alloy project or add the unRetina function to the
pre:compile
hook of your existingalloy.jmk
file:
1234task("pre:load", function(event, logger) {unRetina(event, logger);// other stuff you have}); - Never care about non-retina files again!