No project description provided
Project description
img2ico
A simple CLI tool and Python library to convert images into multi-resolution favicon (.ico) files.
Features
- Convert PNG, JPG, WEBP, BMP to ICO
- Optional SVG support (requires
cairosvg) - Embed multiple icon sizes in one
.icofile (16x16,32x32,48x48by default) - Easy to use CLI and Python API
Installation
pip install pillow
# Optional: for SVG input support
pip install cairosvg
Or if you publish this as a package:
pip install img2ico
# with SVG support
pip install img2ico[svg]
Usage
CLI
img2ico input.png -o favicon.ico -s 16 32 48
Options:
| Option | Description |
|---|---|
-o, --output |
Output file name (default: same as input, with .ico extension) |
-s, --sizes |
Icon sizes to embed (space-separated). Default: 16 32 48 |
-v, --version |
Show current version |
Python API
from pathlib import Path
from img2ico import convert_to_ico
convert_to_ico(
input_path=Path("logo.png"),
output_path=Path("favicon.ico"),
sizes=[(16, 16), (32, 32), (48, 48)],
)
Recommended Sizes
For favicon usage, it is recommended to include:
16x16– browser tab, old browsers32x32– high DPI displays48x48– Windows desktop icons
You can also add 64x64 or larger if you want to future-proof, but it is not strictly necessary.
Development
Clone the repository and install dependencies:
git clone https://github.com/yourname/img2ico.git
cd img2ico
pip install -e ".[svg]"
Run tests or try the CLI:
python -m img2ico input.png
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file img2ico-0.1.0rc0.tar.gz.
File metadata
- Download URL: img2ico-0.1.0rc0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
017406546e72be9c8db9c387c8ad07972a874f97addfe49ede0451c6bfec4099
|
|
| MD5 |
f37909114de4a53f2a9b1b10ff499cce
|
|
| BLAKE2b-256 |
131873446fc99d2ad20a1ded18e1277f669ab41f422eb01eb079275589083dae
|
Provenance
The following attestation bundles were made for img2ico-0.1.0rc0.tar.gz:
Publisher:
release-pypi.yml on yu9824/img2ico
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
img2ico-0.1.0rc0.tar.gz -
Subject digest:
017406546e72be9c8db9c387c8ad07972a874f97addfe49ede0451c6bfec4099 - Sigstore transparency entry: 550966397
- Sigstore integration time:
-
Permalink:
yu9824/img2ico@0043ffa73fd5d9290766a959e1690194141df8e0 -
Branch / Tag:
refs/tags/v0.1.0-rc.0 - Owner: https://github.com/yu9824
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@0043ffa73fd5d9290766a959e1690194141df8e0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file img2ico-0.1.0rc0-py3-none-any.whl.
File metadata
- Download URL: img2ico-0.1.0rc0-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f4ee454e043ae06cfcde2dccd4a03596ba6954d34371c4b7eddd1f9c0a31bd2
|
|
| MD5 |
ae8737985307a197eb923e0cf5ef15a0
|
|
| BLAKE2b-256 |
922bfa9f9bc98266ad63c5787c6d54cb5d5433f3fc18f2e3f1f7ad482780c5fc
|
Provenance
The following attestation bundles were made for img2ico-0.1.0rc0-py3-none-any.whl:
Publisher:
release-pypi.yml on yu9824/img2ico
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
img2ico-0.1.0rc0-py3-none-any.whl -
Subject digest:
3f4ee454e043ae06cfcde2dccd4a03596ba6954d34371c4b7eddd1f9c0a31bd2 - Sigstore transparency entry: 550966401
- Sigstore integration time:
-
Permalink:
yu9824/img2ico@0043ffa73fd5d9290766a959e1690194141df8e0 -
Branch / Tag:
refs/tags/v0.1.0-rc.0 - Owner: https://github.com/yu9824
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@0043ffa73fd5d9290766a959e1690194141df8e0 -
Trigger Event:
push
-
Statement type: