A CLI tool for generating Progressive Web App icons of different sizes in PNG format from an existing image. Built using Ink, React, and Sharp.
A list of image types supported by Sharp can be found here. And below:
- JPEG
- PNG
- WebP
- TIFF
- GIF
- SVG
To install pwa-icon-gen
you can use yarn
or npm
.
yarn global add pwa-icon-gen
# or
npm install --global pwa-icon-gen
pwa-icon-gen logo.svg --out=public/icons/
# custom sizes
pwa-icon-gen logo.svg --out=public/icons/ --sizes=50,100,150,200
Usage: pwa-icon-gen <icon-path> --out=<out-dir> [options]
pwa-icon-gen logo.svg --out=public/icons/
pwa-icon-gen logo.png --out=public/ --sizes=72,144,512
Options:
--out Destination directory for the icons.
--sizes The different sizes to be generated.
Format: comma separated list (i.e. 128,256,512)