icoextract
Extract icons from Windows executables into ICO files
TLDR
SYNOPSIS
icoextract [-n index] [-i id] [-v] input output
DESCRIPTION
icoextract reads icon resources from Windows Portable Executable (PE) files and writes them as a Windows ICO. It also understands Windows 10+ .mun system-resource files, where icons that used to live in `shell32.dll` and similar libraries were moved. An optional nefile extra adds Win16 New Executable (NE) support.The same project ships icolist, which prints every icon group in a file so you can pick an index or resource ID before extracting, and exe-thumbnailer, a FreeDesktop thumbnailer for Linux file managers.Output is always ICO data. If the destination path ends in .png, .jpg, or .jpeg, icoextract still writes ICO bytes and prints a warning; convert the ICO afterwards if you need another format.Requires Python 3.10 or newer and pefile.
PARAMETERS
input
Windows executable to read: .exe, .dll, or .munoutput
Destination .ico path-n index, --num index
0-based index of the icon group to extract (default 0)-i id, --id id
Resource ID of the icon group (integer or string)-v, --verbose
Enable debug logging-V, --version
Print the program version and exit-h, --help
Show usage
INSTALL
CAVEATS
The default --num 0 extracts the first group only. A missing index or resource ID raises an error. Recent Windows system DLLs often contain no icons; extract the matching .mun under `C:\Windows\SystemResources` instead. Win16 NE files need the optional nefile extra. This is a Python CLI (`icoextract.scripts.extract`), not ImageMagick convert.
HISTORY
Written by James Lu (MIT License), first released in 2019. Inspired by extract-icon-py and icoutils. Version 0.3.0 (2026-06-06) added Win16 NE extraction via nefile and string resource IDs.
