Native macOS port of TweakPNG for viewing and editing PNG chunk metadata, while keeping the original project source in this repository.
This repository now contains two parts:
- the original Windows TweakPNG source in the repository root
- a native macOS app built with SwiftUI/AppKit and a reusable C++ PNG core
Runtime and build requirements for the macOS port:
- macOS 13 or newer
- Xcode Command Line Tools
- Swift 6 toolchain (
swift) uvfor the packaging helper environment- Python 3.12 for the icon-generation helper managed by
uv
Optional tools used by packaging:
iconutilcodesignhdiutil
Sources/TweakPNGCore- portable C++ PNG parsing and editing layerSources/TweakPNGMac- native macOS UImacos/build-app.sh- app bundle, zip, and dmg packaging scriptmacos/tools- uv-managed Python helper for icon generationmacos/Assets/AppIconSource.png- source image used for the macOS app icon- root
*.cpp/*.hfiles - original Windows codebase
Build the macOS app:
swift buildRun it directly from SwiftPM:
swift run TweakPNGBuild an optimized executable:
swift build -c releaseThe executable is emitted at:
.build/release/TweakPNG
Create a local distributable app bundle, zip archive, and dmg:
chmod +x macos/build-app.sh
./macos/build-app.shPackaging outputs:
dist/TweakPNG.appdist/TweakPNG-macos.zipdist/TweakPNG.dmgdist/TweakPNG.dSYM
The packaging flow does the following:
- creates or reuses the
uvPython environment inmacos/tools - generates a macOS
.iconsetfrommacos/Assets/AppIconSource.png - converts the iconset into
AppIcon.icns - builds the Swift release executable
- assembles the
.appbundle - applies ad-hoc signing by default
- emits a
.zipand.dmg
This repository is currently configured to work without a paid Apple Developer certificate. By default, the packaging script performs ad-hoc signing so the app can still be built and shared for local testing.
If you later install a real signing identity, you can override the signer:
SIGN_IDENTITY="Developer ID Application: GamerNoTitle" ./macos/build-app.shWithout a real Developer ID certificate and notarization, macOS may warn users on first launch. That is expected for the current release flow.
Project dependencies by layer:
TweakPNGCore- C++17
- system
zlib
TweakPNG- SwiftUI
- AppKit
- Swift/C++ interoperability
macos/tools- Python 3.12
- Pillow
- open PNG files
- inspect chunk rows with type, length, CRC, attributes, and summary
- preview the current image in a native macOS inspector pane
- add
tEXtchunks - delete and reorder chunks
- save and save as
- package as
.app,.zip, and.dmg
- The original Windows code is intentionally preserved and remains in the repo.
- The macOS port is a native implementation, not a Win32 compatibility layer.
- Some advanced Windows-era editing dialogs and chunk-specific editors are not yet ported.
- Original TweakPNG project by Jason Summers
- Original project page:
https://entropymine.com/jason/tweakpng/ - Original source repository:
https://github.com/jsummers/tweakpng