Exe2Iconset
Cross-platform tool to extract icons from Windows EXE/DLL files, image files, or directories 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:
# After pip install
exe2iconset-gui
# Or with python -m
python -m exe2iconset
Or import and run:
from exe2iconset import run_icon_picker
run_icon_picker()
GUI Workflow
- Select Input File: Click "Browse..." or enter path and press Enter
- Extract Icons: Extraction starts automatically after file selection. A progress bar shows extraction progress.
- Select Series: Choose an icon series from the Treeview list
- Create ICNS: Enter output name and click "Create ICNS"
- Save Location: ICNS file will be saved in the selected output directory
The icon list shows compact details like ID:101, LANG:1033, all:64²×32bit where:
- ID: Resource ID (e.g., 101)
- LANG: Language code (e.g., 1033 = English)
- all: All sizes in the group (e.g., 64²×32bit means 64x64 at 32-bit color)
Click the status bar to view the full activity log in a popup window.
CLI
# Using the installed command
exe2iconset <file.exe> --list
# Or with python -m
python -m exe2iconset <file.exe> --list
# Create ICNS from specific group (PE files)
exe2iconset <file.exe> -g icongroup_47_1033 -o output.icns
# Create ICNS from image file
exe2iconset <image.png> -o output.icns
# Create ICNS with iconset directory for inspection
exe2iconset <file.exe> -o output.icns --iconset
# Verbose output for debugging
exe2iconset <file.exe> -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_images, create_icns_from_images, convert_icons_to_icns_sizes, ICON_TYPE_MAP
# Extract icons/images from PE file, image file, or directory
# Returns dict mapping group name to list of icon dicts
icon_groups = extract_images("app.exe") # PE file
icon_groups = extract_images("image.png") # Single image
icon_groups = extract_images("images/") # Directory
# Get the first group (or specific group by name)
first_group_key = list(icon_groups.keys())[0]
icon_data_list = icon_groups[first_group_key]
# Convert extracted icons to PIL images with resolutions, suitable for ICNS
mac_icon_sizes = list(ICON_TYPE_MAP.keys())
icon_images = convert_icons_to_icns_sizes(icon_data_list, mac_icon_sizes)
# Create ICNS from images
create_icns_from_images(icon_images, "app.icns")
# Also you can save images as iconset directory
save_iconset(icon_images, "app.iconset")
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/
Known Issues
Drag and Drop on macOS with Tcl/Tk 9.x
If the GUI fails to start with an error like "RuntimeError: Unable to load tkdnd library" or "this extension is compiled for Tcl 8.x", this indicates a Tcl/Tk version incompatibility.
Problem: tkinterdnd2's tkdnd extension is compiled for Tcl 8.x, but macOS with Homebrew may have Tcl/Tk 9.x linked by default.
Solution: Download and replace tkdnd binaries with Tcl 9.x compatible ones:
-
Download from https://github.com/petasis/tkdnd/releases:
- For Apple Silicon (M1/M2/M3):
tkdnd-2.9.5-macOS-tcl9.0-arm64-x64-14.2.1.tgz - For Intel Macs:
tkdnd-2.9.5-macOS-tcl9.0-x86_64-x64-14.2.1.tgz
- For Apple Silicon (M1/M2/M3):
-
Extract the archive and copy contents to your tkinterdnd2 installation:
# Find your tkinterdnd2 location python -c "import tkinterdnd2; print(tkinterdnd2.__file__)" # Navigate to tkdnd folder and replace files from the archive # The archive contains osx-arm64/ or osx-x64/ folder with: # - libtkdnd2.X.X.dylib (the binary) # - pkgIndex.tcl # - *.tcl files
Alternatively, try linking Tcl/Tk 8.x via Homebrew (may require rebuilding your virtual environment):
brew install tcl-tk@8
brew unlink tcl-tk
brew link tcl-tk@8
Drag and Drop on Linux/Wayland
On some Linux distributions running Wayland, drag-and-drop from file managers may work inconsistently (sometimes fires, sometimes doesn't). This is a known tkinterdnd2 limitation with Wayland's inter-app DnD protocol.
Workaround: Use the "Browse..." button to select files, or try running with X11 session instead of Wayland.
Metadata
Release files for exe2iconset 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| exe2iconset-0.3.2.tar.gz | 6.8 MB | With provenance | Details for exe2iconset-0.3.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| exe2iconset-0.3.2-py3-none-any.whl | Python 3 | none | any | Details for exe2iconset-0.3.2-py3-none-any.whl |
Total release size: 13.7 MB
Release files / exe2iconset-0.3.2.tar.gz
| Download URL | exe2iconset-0.3.2.tar.gz |
|---|---|
| Size | 6.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0b57a188853793629b0a175130b7194ed05125d1e16feb616aa64cb9b35aafb3
|
|
BLAKE2b-256 checksum How to use checksums |
d2176503bfd9a4ef9ab6e32473f75e2c3157ef437b68007188af76e017e82435
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logRelease files / exe2iconset-0.3.2-py3-none-any.whl
| Download URL | exe2iconset-0.3.2-py3-none-any.whl |
|---|---|
| Size | 6.8 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
332d6286dcde1c12b77ad4baeead927f8f84d0ee1fdda7983287be8b00f26f46
|
|
BLAKE2b-256 checksum How to use checksums |
1cdb6e7a9922bb13e37b6743a93124c8cfa6388abd4f407588271b5a248e4a45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logSecurity for exe2iconset 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for exe2iconset-0.3.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.