https://github.com/marcusfrdk/create-app-icon
Use a single command to resize a local or remote image to all the required sizes and formats used in various forms of development.
https://github.com/marcusfrdk/create-app-icon
android app app-icon-generator apple-watch icon ios python web
Last synced: 5 months ago
JSON representation
Use a single command to resize a local or remote image to all the required sizes and formats used in various forms of development.
- Host: GitHub
- URL: https://github.com/marcusfrdk/create-app-icon
- Owner: marcusfrdk
- Created: 2021-02-21T11:13:28.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2022-10-15T20:00:40.000Z (over 3 years ago)
- Last Synced: 2023-05-16T16:33:35.670Z (about 3 years ago)
- Topics: android, app, app-icon-generator, apple-watch, icon, ios, python, web
- Language: Python
- Homepage:
- Size: 18.6 MB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

# Create App Icon





Use a single command to resize a local or remote image to all the required sizes and formats used in various forms of development.
## Get Started
### Requirements
- Python 3.6 or higher
### Installation
To get started with the package, run the following commands in your terminal:
```bash
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`_
### Supported Images
This project uses [Pillow](https://python-pillow.org/) to handle image files, [here's the list.](https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html)
Note: _If you round an image with transparency, the images background will be set to black_.
## Usage
### Examples
_If you are on Windows, use `python` instead of `python3`_
#### Local image
```bash
python3 main.py ./path/to/image.jpg
```
#### Remote image
```bash
python3 main.py "https://example.com/image.jpg" # make sure to stringify the url
```
#### Specific preset
```bash
python3 main.py ./path/to/image.jpg --{PRESET}
```
#### Align image
```bash
python3 main.py ./path/to/image.jpg --align top # aligns vertically
```
```bash
python3 main.py ./path/to/image.jpg --align left # aligns horizontally
```
```bash
python3 main.py ./path/to/image.jpg --align bottom right # aligns both vertically and horizontally
```
#### Custom Favicon Border Radius
```bash
python3 main.py ./path/to/image.jpg --radius 15 # percentage (0-100)
```
### Command Line Arguments
| 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 |
## Aliasing (Linux/MacOS)
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:
```bash
alias cai="python3 /path/to/create-app-icon/main.py"
```
## Credits
- [Landscape example image](https://unsplash.com/photos/HpVgq2BIjbw)
- [Portrait example image](https://unsplash.com/photos/odJtBMxGEfk)