https://github.com/oclero/icoutil
π Simple Python library to create .ICO files (Windows icon file format).
https://github.com/oclero/icoutil
ico icon python windows
Last synced: 8 months ago
JSON representation
π Simple Python library to create .ICO files (Windows icon file format).
- Host: GitHub
- URL: https://github.com/oclero/icoutil
- Owner: oclero
- License: mit
- Created: 2024-01-18T20:18:46.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-22T18:02:00.000Z (over 1 year ago)
- Last Synced: 2024-10-01T18:19:11.450Z (about 1 year ago)
- Topics: ico, icon, python, windows
- Language: Python
- Homepage: https://github.com/oclero/icoutil
- Size: 936 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# IcoUtil
[](https://www.python.org)
[](https://mit-license.org/)
[](https://pypi.org/project/icoutil)A simple Python library to create `.ico` files (Windows icon file format) from `.png` files.
**Table of contents**
- [Install](#install)
- [Usage](#usage)
- [As a library](#as-a-library)
- [As a CLI program](#as-a-cli-program)
- [Remarks](#remarks)
- [Creator](#creator)
- [License](#license)## Install
Use the [PyPi.org](https://pypi.org/project/icoutil) package index:
```sh
pip3 install icoutil
```## Usage
### As a library
Two ways to use the library:
- Creating a `.ico` file from a single directory that contains multiple `.png` files:
```py
import icoutilico = icoutil.IcoFile()
ico.add_png_dir('path/to/dir')
ico.write('output.ico')
```- Creating a `.ico` file from multiple `.png` files:
```py
import icoutilico = icoutil.IcoFile()
ico.add_png('path/to/image1.png')
ico.add_png('path/to/image2.png')
ico.add_png('path/to/image3.png')
ico.add_png('...')
ico.write('output.ico')
```### As a CLI program
Two ways to use the CLI:
- Creating a `.ico` file from a single directory that contains multiple `.png` files:
```sh
icoutil --output "icon.ico" "path/to/dir"
```- Creating a `.ico` file from multiple `.png` files:
```sh
icoutil --output "icon.ico" "path/to/image1.png" "path/to/image2.png" "path/to/image3.png" ...
```## Remarks
- The file specification can be read [here]().
- The following sizes are used by Windows, but not all required:
- 16Γ16
- 20Γ20
- 24Γ24
- 32Γ32
- 40Γ40
- 48Γ48
- 64Γ64
- 96Γ96
- 128Γ128
- 256Γ256
- This library won't consider sizes outside the ones specified above.
- The maximum allowed size is 256Γ256 pixels.## Creator
**Olivier ClΓ©ro** | [email](mailto:oclero@pm.me) | [website](https://www.olivierclero.com) | [github](https://www.github.com/oclero) | [gitlab](https://www.gitlab.com/oclero)
## License
This project is available under the MIT license. See the [LICENSE](LICENSE) file for more info.