PyIMG4 is a Python library and CLI tool designed for parsing, manipulating, and creating Apple's proprietary Image4 format, including IMG4, IM4M (manifest), and IM4P (payload) files. It is currently at version 0.8.8 and maintains a relatively active release cadence, with updates addressing bugs, adding features, and refining internal logic.
pip install pyimg4Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to parse an Image4 file, display its contents, and extract the IM4P payload data using PyIMG4. It simulates reading a dummy Image4 file for immediate execution.
Upgrade Python to 3.9 or higher: `pyenv install 3.9` / `conda install python=3.9`.
Ensure a clean reinstall to pick up new dependencies: `pip install --no-cache-dir --upgrade pyimg4`. If issues persist, manually install: `pip install apple-compress` (macOS) or `pip install lzfse` (other OS).
Update imports and code to use the new class names for manifest properties and image data.
Downgrade `asn1`: `pip install 'asn1<3.0.0'`. Consider using a virtual environment to manage dependencies.
Ensure PyIMG4 is installed in your current environment: `python3 -m pip install pyimg4`. If using a virtual environment, activate it first. For system-wide issues on Linux, ensure `python3-pip` is installed and the 'universe' repository is enabled (`sudo add-apt-repository universe && sudo apt update`).
Ensure development headers and compilers are installed (e.g., `sudo apt install build-essential python3-dev` on Debian/Ubuntu, or Xcode Command Line Tools on macOS). Reinstall `pyimg4` with caching disabled: `pip install --no-cache-dir --upgrade pyimg4`.
Upgrade PyIMG4 to the latest version: `pip install --upgrade pyimg4`. This issue was addressed in v0.8.7.