Skip to main content

Extract icons from Windows EXE/DLL files and create macOS ICNS files

Project description

Exe2Iconset

Cross-platform tool to extract icons from Windows EXE/DLL files and create macOS ICNS files.

Installation

From PyPI (recommended)

pip install exe2iconset

From source

pip install .

Or install in development mode:

pip install -e .

Requirements

  • Python >= 3.10
  • Pillow >= 10.0.0
  • pefile >= 2023.2.7

Usage

GUI

Run the GUI application:

python -m exe2iconset

Or import and run:

from exe2iconset import run_gui
run_gui()

GUI Workflow

  1. Select EXE File: Click "Browse..." to select a Windows executable (EXE, DLL, MUN)
  2. Extract Icons: Click "Extract Icons" to extract icon groups from the PE file
  3. Select Series: Choose an icon series from the list in Step 2
  4. Create ICNS: Enter output name and click "Create ICNS"
  5. Save Location: ICNS file will be saved in the selected output directory

CLI

# Using the installed command
exe2iconset <file.exe> --list

# Or with python -m
python -m exe2iconset <file.exe> --list

# Create ICNS from specific group
exe2iconset <file.exe> -g icongroup_47_1033 -o output.icns

# Create ICNS with iconset directory for inspection
exe2iconset <file.exe> -o output.icns --iconset

CLI Examples

# List all icon groups in a file
exe2iconset app.exe --list

# Extract icons using the first available group
exe2iconset app.exe -o app.icns

# Extract from a specific group (shown in --list output)
exe2iconset app.exe -g icongroup_3_1033 -o myapp.icns

# Create iconset directory for manual inspection
exe2iconset app.exe -o app.icns --iconset

# Verbose output
exe2iconset app.exe -o app.icns -v

CLI Options

Option Description
-l, --list List available icon groups and exit
-g, --group GROUP Icon group to use (e.g., icongroup_3_1033)
-o, --output FILE Output ICNS file (default: appicon.icns)
--iconset Also create iconset directory
-v, --verbose Enable verbose output

Python API

from exe2iconset import extract_icons_from_pe, create_icns_from_images

# Extract icons from PE file
icon_groups = extract_icons_from_pe("app.exe")

# Create ICNS from images
create_icns_from_images(icon_images, "app.icns")

ICNS Format

The application creates ICNS files with these standard macOS icon types:

Type Size Format Notes
ic04 16×16 ARGB PackBits compressed
ic05 32×32 ARGB PackBits compressed
icp6 48×48 PNG
ic12 64×64 PNG Can serve as 32@2x retina
ic07 128×128 PNG
ic08 256×256 PNG
ic09 512×512 PNG
ic10 1024×1024 PNG Can serve as 512@2x retina

Notes on ICNS

  • ARGB format (ic04/ic05) preserves alpha channel correctly
  • PNG format is used for larger icons
  • Retina versions are handled automatically by macOS - no need to create explicit @2x variants
  • The ICNS format is flexible - only the sizes available from the source are included

For details on ICNS format, see:

Testing

Run tests with pytest:

# Install test dependencies
pip install exe2iconset[dev]

# Or install from source with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest tests/

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

exe2iconset-0.1.0.tar.gz (20.1 kB view details)

Uploaded Source

Built Distribution

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

exe2iconset-0.1.0-py3-none-any.whl (23.3 kB view details)

Uploaded Python 3

File details

Details for the file exe2iconset-0.1.0.tar.gz.

File metadata

  • Download URL: exe2iconset-0.1.0.tar.gz
  • Upload date:
  • Size: 20.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for exe2iconset-0.1.0.tar.gz
Algorithm Hash digest
SHA256 34e6a0f7767eb30714d2cf737c7f7a8e92faa3249a25c4986b0090be26abe769
MD5 5afd45cd3e5d2adec529ff94d293a5eb
BLAKE2b-256 ca055f6bb546400533349fdc9317c88defb34f61ab962ec2a7a4b257436643de

See more details on using hashes here.

File details

Details for the file exe2iconset-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: exe2iconset-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for exe2iconset-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8de46b89c448fd90ef8721b7b5a54913396572f38a5fc5e07b25168835a1b7f8
MD5 ed3b699ed537ca0068f1cc5b48f56a97
BLAKE2b-256 0748dee10bb88d4d0a574d7100c09d25b125c4ec2f5df23dd101b86af334aa7f

See more details on using hashes here.

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