Home

Awesome

mobicon Build Status

Mobile app icon generator

Install

$ npm install --save mobicon

GraphicsMagick

This library depends on GraphicsMagick, so be sure to install this library as well.

Mac OSX

$ brew install graphicsmagick

Linux

$ sudo apt-get install graphicsmagick

Windows

Manual installation or via chocolatey.

$ choco install graphicsmagick

Usage

const mobicon = require('mobicon');

mobicon('icon.png', {platform: 'android'}).then(() => {
    // icons generated
});

mobicon('icon.svg', {platform: 'ios', background: '#ff0000', contentRatio: 1}).then(() => {
    // icons generated
});

API

mobicon(file, options)

file

Type: string

Source file of the icon.

options

platform

Required<br> Type: string<br> Values: pwa android ios blackberry10

Platform to generate the icons for.

background

Type: string<br> Default: white

Color of the icon background if the icon is transparant.

contentRatio

Type: number<br> Default: 1

Logo-icon ratio. 1 means the logo will fill up the entire width (or height) of the icon, 0.5 means it will only fill up half of the icon.

roundedCorners

Type: boolean<br> Default: true (only for Android and PWA)

Boolean indicating if the generated icons should have rounded corners. This is true by default for the Android and PWA platform, false otherwise.

borderRadius

Type: number<br> Default: 0.0909

The corner radius percentage of the generated icon. The default value is 9.09%. See the material design styleguide for more information.

dest

Type: string<br> Default: process.cwd()

Directory to save the generated icons.

Platforms

The supported platforms are PWA, Android, iOS and BlackBerry 10. Every platform generates a different set of icons.

PWA

Android

iOS

BlackBerry 10

Related

License

MIT © Sam Verschueren