How d13young/flipper-asset-studio works
Purpose and entry points
Flipper Asset Studio is a cross-platform desktop authoring tool for Momentum Firmware/Flipper Zero graphic asset packs. It imports source images, edits animations or Passport icons, renders previews, exports Flipper-compatible files, and validates pack layouts. Runtime starts at main.py; the primary GUI composition root is ui/main_window.py. A script-oriented packer is also present at scripts/asset_packer.py.
Desktop UI shell and workflows
PyQt6 provides the application runtime and user-facing workflow routing. The main window hosts creation, animation, icon, and validation views, while shared localized text and packaged-resource lookup support the desktop shell.
• ui/main_window.py
• ui/create_editor.py
• ui/i18n.py
• ui/resources.py
Animation authoring pipeline
Animation state—frames and playback/export metadata such as FPS, duration, levels, butthurt ranges, and weight—is managed separately from UI rendering. The timeline provides frame ordering and interactive controls; imported files can enter through drag-and-drop. This stage produces the model consumed by preview and export.
• core/animation_manager.py
• ui/animation_timeline.py
• ui/drag_drop_widget.py
Image ingestion and normalization
Source PNGs, and editor-assisted GIF/JPG inputs, cross into the core image-processing boundary. Images are resized/centered and converted to Flipper’s 1-bit representation, with Floyd–Steinberg dithering intended to preserve detail. UI crop editors prepare user-selected source regions before this conversion path.
• core/image_processor.py
• ui/gif_crop_editor.py
• ui/jpg_crop_editor.py
Flipper binary formats and export
Export converts normalized frames into raw .bm or Heatshrink-compressed .bmx, writes animation meta.txt and manifest.txt, and materializes Momentum-compatible Anims/ and Icons/Passport/ directory layouts. Icon export has a dedicated builder for supported Passport dimensions and binary metadata. Decoder utilities provide the complementary .bm/.bmx interpretation boundary.
• core/exporter.py
• core/icon_builder.py
• core/bm_bmx_decoder.py
Validation boundary
Pack validation is independent of editing/export and checks exported or external asset-pack structure, metadata, frame sizing, and sequence consistency. Its results are presented through a dedicated UI widget, making validation usable before deployment to device storage.
• core/validator.py
• ui/validator_widget.py
Runtime, packaging, and delivery
The application targets Python 3.10+, with PyQt6, Pillow/NumPy for image work, and heatshrink2 for BMX compression. PyInstaller packages a one-file/windowed executable with bundled assets; platform build scripts wrap the spec. GitHub Actions publishes tagged release builds for Windows, macOS arm64, and Linux. No server, database, or network service is part of the operational architecture.
• FlipperAssetStudio.spec
• scripts/build.sh
• scripts/build_windows.bat
• .github/workflows/release.yml
Main entry points: main_window.py Main window · animation_manager.py Animation model · image_processor.py Image normalization · exporter.py Animation exporter
Components 19
Desktop application
- Application entry
main.py - Main window · Composes creation, animation, icon, and validation workflows.
ui/main_window.py - UI resources and i18n
ui/i18n.py - Creation editor
ui/create_editor.py
Authoring pipeline
- Animation model · Owns frames and playback/export metadata.
core/animation_manager.py - Animation timeline
ui/animation_timeline.py - Drag-and-drop import
ui/drag_drop_widget.py - GIF/JPG crop editors · Prepare selected source regions before normalization.
ui/gif_crop_editor.py - Image normalization · Resizes, centers, dithers, and converts images to 1-bit frames.
core/image_processor.py - Preview rendering
Export and validation
- Animation exporter · Writes frame binaries, metadata, and Momentum animation layouts.
core/exporter.py - Passport icon builder · Builds supported icon binaries and metadata.
core/icon_builder.py - BM/BMX decoder · Interprets raw and Heatshrink-compressed frame files.
core/bm_bmx_decoder.py - Pack validator · Checks layout, metadata, sizing, and frame sequences.
core/validator.py - Validation results
ui/validator_widget.py - Script packer
scripts/asset_packer.py
Build and release
- PyInstaller packaging · Builds a bundled one-file/windowed executable.
FlipperAssetStudio.spec - Platform build scripts
scripts/build.sh - Release workflow · Publishes tagged Windows, macOS arm64, and Linux builds.
.github/workflows/release.yml
Connections 18
- Application entry → Main window: starts
- Main window → UI resources and i18n: uses
- Main window → Creation editor: hosts
- Main window → Animation timeline: hosts
- Main window → Validation results: hosts
- Drag-and-drop import → Image normalization: imports images
- GIF/JPG crop editors → Image normalization: prepares regions
- Image normalization → Animation model: creates normalized frames
- Animation timeline → Animation model: edits ordering
- Animation model → Preview rendering: drives
- Animation model → Animation exporter: exports frames and metadata
- Image normalization → Passport icon builder: supplies 1-bit images
- Animation exporter → BM/BMX decoder: writes BM/BMX
- BM/BMX decoder → Pack validator: reads exported frames
- Pack validator → Validation results: reports results
- Script packer → Animation exporter: scripted packing
- Platform build scripts → PyInstaller packaging: invokes
- Release workflow → Platform build scripts: runs platform builds