Skip to main content

Easily create all appropriate icon sizes for a Windows app from a single source image

Project description

Make Windows Icons

This script resizes a given image to various sizes and creates a set of icons for a Windows application. The generated icons are saved in PNG format, and an ICO file is created that packs all the icons together.

Features

  • Resize a single source image to multiple sizes.
  • Save the resized images in PNG format.
  • Create an ICO file containing all the resized icons.
  • Optionally, specify additional sizes to resize the image to.

Requirements

  • Python 3.11+

Installation

  1. Install with pip:
python3 -m pip install makewindowsicons

Usage

python3 -m makewindowsicons <input_image> <app_name> [--output_dir <output_directory>] [--no_dir] [-s <size>]...

Arguments

  • <input_image>: Path to the source image.

Options

  • <app_name>: Name of the application. Default is 'app'.
  • --output_dir <output_directory>: Directory to save the output resources. Default is the current directory.
  • --no_dir: Do not create a 'resources' directory; save images directly to the specified output directory.
  • -s <size>, --size <size>: Additional sizes to resize the image to. Can be specified multiple times.

Examples

  1. Default behavior:

    Resize the image to the default sizes and save in the resources directory within the current directory:

    python3 -m makewindowsicons your_source_image.png YourAppName
    
  2. Specify output directory:

    Resize the image to the default sizes and save in the resources directory within the specified output directory:

    python3 -m makewindowsicons your_source_image.png YourAppName --output_dir output_path
    
  3. Without creating resources directory:

    Resize the image to the default sizes and save directly in the specified output directory:

    python3 -m makewindowsicons your_source_image.png YourAppName --output_dir output_path --no_dir
    
  4. Add additional sizes:

    Resize the image to the default sizes plus additional sizes (e.g., 37px, 69px, 420px) and save in the resources directory within the specified output directory:

    python3 -m makewindowsicons your_source_image.png YourAppName --output_dir output_path -s 32 -s 72 -s 128
    

Contributing

Feel free to submit issues or pull requests if you find any bugs or have suggestions for improvements.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

makewindowsicons-0.1.19.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

makewindowsicons-0.1.19-py3-none-any.whl (5.9 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