Use a single command to resize a local or remote image to all the required sizes and formats used in various forms of development.
- Python 3.6 or higher
To get started with the package, run the following commands in your terminal:
git clone https://github.com/marcusfrdk/create-app-icon.git # or download the repository manually
cd create-app-icon
pip3 install -r requirements.txt
If you are on Windows, use pip
instead of pip3
This project uses Pillow to handle image files, here's the list.
Note: If you round an image with transparency, the images background will be set to black.
If you are on Windows, use python
instead of python3
python3 main.py ./path/to/image.jpg
python3 main.py "https://example.com/image.jpg" # make sure to stringify the url
python3 main.py ./path/to/image.jpg --{PRESET}
python3 main.py ./path/to/image.jpg --align top # aligns vertically
python3 main.py ./path/to/image.jpg --align left # aligns horizontally
python3 main.py ./path/to/image.jpg --align bottom right # aligns both vertically and horizontally
python3 main.py ./path/to/image.jpg --radius 15 # percentage (0-100)
Argument | Description | Type |
---|---|---|
path | path or uri to image | str |
--ios | generate ios icons | bool |
--ipad | generate iPad icons | bool |
--apple-watch | generate Apple Watch icons | bool |
--android | generate Android icons | bool |
--web | generate Web icons | bool |
-r, --radius | sets the border radius of the favicon | bool |
-a, --align | aligns the image | top, right, bottom, left |
This project works relatively to the current working directory, so adding an alias to the script can make it easier to use. To add an alias, add the following line to your .bashrc
or .zshrc
file:
alias cai="python3 /path/to/create-app-icon/main.py"