Skip to main content

Simple Python library to create .ICO files (Windows icon file format).

Project description

IcoUtil

python License: MIT PyPi version

A simple Python library to create .ico files (Windows icon file format) from .png files.

Table of contents

Install

Use the PyPi.org package index:

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:

    import icoutil
    
    ico = icoutil.IcoFile()
    ico.add_png_dir('path/to/dir')
    ico.write('output.ico')
    
  • Creating a .ico file from multiple .png files:

    import icoutil
    
    ico = 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:

    icoutil --output "icon.ico" "path/to/dir"
    
  • Creating a .ico file from multiple .png files:

    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 | website | github | gitlab

License

This project is available under the MIT license. See the LICENSE file for more info.

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

icoutil-1.0.2.tar.gz (7.4 kB view hashes)

Uploaded Source

Built Distribution

icoutil-1.0.2-py3-none-any.whl (7.2 kB view hashes)

Uploaded Python 3

Supported by

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