A Python tool to convert PNG images into C++ header files for Nintendo Switch boot splash screens compatible with Atmosphère.
This script converts PNG images into a C++ include file format that can be used for custom boot splash screens on the Nintendo Switch. The output format is compatible with Atmosphère's splash screen implementation.
- Validates image dimensions against Nintendo Switch display resolution (1280x720 max)
- Automatically centers images on the screen
- Converts RGBA pixels to ARGB format with premultiplied alpha
- Generates C++ header files with proper formatting and static assertions
- Python 3.x
- Pillow (PIL) library
- Clone or download this repository
- Install dependencies:
pip install -r requirements.txtOr if using a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txtpython png2splash.py <image.png>python png2splash.py splash.pngThis will generate boot_splash_screen_notext.inc containing the C++ header file with the splash screen data.
The script generates a C++ header file (boot_splash_screen_notext.inc) containing:
- Constants for splash screen position and dimensions:
SplashScreenX- X coordinate (centered)SplashScreenY- Y coordinate (centered)SplashScreenW- Width in pixelsSplashScreenH- Height in pixels
- Pixel data array
SplashScreen[]in ARGB format - Static assertion to verify array size
- Format: PNG (with transparency support)
- Maximum resolution: 1280x720 pixels (Nintendo Switch display resolution)
- Images larger than the maximum will be rejected with an error
This project is licensed under the GNU General Public License v2.0. See the LICENSE file for details.
The generated output files include the GPL v2 license header as used by Atmosphère-NX.