This README provides a comprehensive guide to the MCE OLED Toolset, specifically designed for processing, previewing, and managing monochrome splash images for OLED displays.
This toolset consists of two primary Python applications:
- MCE.OLED.EDITOR: A powerful image processing utility to convert standard images into MCE OLED format.
- MCE.OLED.GALLERY: A curated browser for navigating and previewing large libraries of splash screens in a simulated hardware environment.
The Editor is the "foundry" of the project. It handles the heavy lifting of converting high-resolution, color images into the 1-bit (monochrome) format required by FlipperMCE / GCMCE.
-
Drag-and-Drop Interface: Utilizes
tkinterdnd2to allow users to simply drop any image file into the window for immediate processing. - Advanced Dithering: Implements multiple algorithms (Floyd-Steinberg and Ordered Dithering) to maintain visual detail when downscaling from 16 million colors to just two.
-
Automatic Resizing: Targets the standard
$128 \times 64$ resolution (or custom dimensions defined in the script), ensuring aspect ratios are maintained via smart padding or cropping. - Data Export: Generates the raw byte arrays or C-style headers needed for firmware integration.
The Gallery serves as a specialized browser for exploring the database.json catalog of existing splash screens.
- Hardware Preview: Instead of showing a raw flat image, it overlays the splash screens onto a hardware frame (
gcmcepr.png), giving a "What You See Is What You Get" (WYSIWYG) look. - Database Integration: It parses a JSON-based database to allow for rapid searching and categorization of images.
- Resource Management: Uses a custom
resource_pathlogic to ensure that even when compiled into an executable, it can find its internal assets (icons and frames) within the temporary PyInstaller_MEIPASSdirectory.
To run these scripts from source, you will need Python 3.10+ and the following dependencies:
| Library | Purpose |
|---|---|
| Pillow (PIL) | Image manipulation and pixel processing. |
| NumPy | High-performance array operations for dithering logic. |
| tkinterdnd2 | Enables the Drag-and-Drop functionality for the UI. |
| PyInstaller | (Optional) Required only if you wish to build standalone .exe files. |
It is recommended to use a virtual environment to keep your system clean:
# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install pillow numpy tkinterdnd2
Launch the scripts directly using the Python interpreter:
- To edit/convert images:
python MCE.OLED.EDITOR.py - To browse the collection:
python MCE.OLED.GALLERY.py
If you want to build these tools yourself as .exe files so others don't need Python installed, use PyInstaller.
Note: Because these apps rely on external assets (like
.pngframes or.jsondatabases), you must "bundle" these files into the executable using the--add-dataflag.
python -m PyInstaller --onefile --windowed --add-data "gcmcepr.png;." --icon="edit.ico" MCE.OLED.EDITOR.py
python -m PyInstaller --onefile --windowed --add-data "gcmcepr.png;." --add-data "database.json;." --icon="gallr.ico" MCE.OLED.GALLERY.py
--onefile: Packs everything into a single executable.--windowed: Prevents a black console window from opening in the background.--add-data "file;destination": Tells PyInstaller to put the file inside the internal app folder. Use;on Windows and:on Linux/macOS.
- TkinterDnD Errors: If the app fails to start with a "TclError," ensure you have installed
tkinterdnd2correctly. On some Linux distributions, you may also need thepython3-tksystem package. - Missing Images: Ensure
gcmcepr.pngis in the same folder as the script when running locally, or properly bundled when building the EXE.