Icon Set Creator

  • ๐ŸŒˆ Easy to install โ€” does not require additional programs
  • โšก๏ธ Fast โ€” image manipulation powered by sharp
  • ๐Ÿ›  Configurable โ€” using cli options or config file
  • ๐ŸŒŸ Adaptive Icons โ€” support for color and image backgrounds
  • ๐Ÿ“ฑ iOS and Android support โ€” create icons for both platforms with one command

๐Ÿš€ Installation

Global

To install the new package globally, use one of the following commands. You need administrator privileges to execute these unless npm was installed on your system through a Node.js version manager (e.g. n or nvm).

$ npm install -g icon-set-creator
# OR
$ yarn global add icon-set-creator

After installation, you will have access to the iconset binary in your command line. You can verify that it is properly installed by simply running iconset, which should present you with a help message listing all available commands.

You can check you have the right version with this command:

$ iconset --version

Local for a project

If you want to install the icon-set-creator locally, use one of the following commands:

$ npm install icon-set-creator -D
# OR
$ yarn add icon-set-creator -D

๐Ÿงช Usage

The easiest way to use icon-set-creator is to specify the path to icon using iconset create command in root of your project:

$ iconset create ./icon.png

If you have the package installed locally, you can do same with the package.json script and then run it with npm run create-appicon:

{
  "scripts": {
    "create-appicon": "iconset create ./icon.png"
  }
}

It will generate icons of different sizes for Android and iOS.

There are two ways you can configure icon-set-creator. The first with the cli parameters, and the second is through the config file iconset.config.js or package.json depending on your code style.

Config options

  • imagePath โ€” The location of the icon image file which you want to use as the app launcher icon. e.g. ./assets/icon.png
  • android/ios (optional): true โ€” Override the default existing Flutter launcher icon for the platform specified, false โ€” ignore making launcher icons for this platform, icon_name โ€” this will generate a new launcher icons for the platform with the name you specify, without removing the old default existing Flutter launcher icon.
  • imagePathAndroid โ€” The location of the icon image file specific for Android platform (optional โ€” if not defined then the imagePath is used)
  • imagePathIos โ€” The location of the icon image file specific for iOS platform (optional โ€” if not defined then the imagePath is used)

The next two attributes are only used when generating Android launcher icon:

  • adaptiveIconBackground โ€” The color (E.g. "#ffffff") or image asset (E.g. "assets/images/dark-background.png") which will be used to fill out the background of the adaptive icon
  • adaptiveIconForeground โ€” The image asset which will be used for the icon foreground of the adaptive icon

CLI options

Usage: iconset create [options] [image-path]

Generate a new icon set for React Native project

Options:
  -A, --android [icon-name]                    Generate icon set for android
  -IPA, --image-path-android                   Image path for android
  -b, --adaptive-icon-background <background>  The color (E.g. "#ffffff") or image asset (E.g. "assets/images/christmas-background.png") which will be used to fill
                                               out the background of the adaptive icon.
  -f, --adaptive-icon-foreground <foreground>  The image asset which will be used for the icon foreground of the adaptive icon
  -I, --ios                                    Generate icon set for ios
  -IPI, --image-path-ios                       Image path for ios
  -h, --help                                   display help for command

๐Ÿ‘€ Example

You can check the example folder for example icons and this guide on Medium.

GitHub

https://github.com/martiliones/icon-set-creator