Skip to main content

No project description provided

Project description

img2ico

CI docs release-pypi

Ruff mypy

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 .ico file (16x16, 32x32, 48x48 by 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 browsers
  • 32x32 – high DPI displays
  • 48x48 – 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

img2ico-0.1.0rc0.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

img2ico-0.1.0rc0-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

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

Hashes for img2ico-0.1.0rc0.tar.gz
Algorithm Hash digest
SHA256 017406546e72be9c8db9c387c8ad07972a874f97addfe49ede0451c6bfec4099
MD5 f37909114de4a53f2a9b1b10ff499cce
BLAKE2b-256 131873446fc99d2ad20a1ded18e1277f669ab41f422eb01eb079275589083dae

See more details on using hashes here.

Provenance

The following attestation bundles were made for img2ico-0.1.0rc0.tar.gz:

Publisher: release-pypi.yml on yu9824/img2ico

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for img2ico-0.1.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f4ee454e043ae06cfcde2dccd4a03596ba6954d34371c4b7eddd1f9c0a31bd2
MD5 ae8737985307a197eb923e0cf5ef15a0
BLAKE2b-256 922bfa9f9bc98266ad63c5787c6d54cb5d5433f3fc18f2e3f1f7ad482780c5fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for img2ico-0.1.0rc0-py3-none-any.whl:

Publisher: release-pypi.yml on yu9824/img2ico

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page