Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

png2splash

A Python tool to convert PNG images into C++ header files for Nintendo Switch boot splash screens compatible with Atmosphère.

Description

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.

Features

  • 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

Requirements

  • Python 3.x
  • Pillow (PIL) library

Installation

  1. Clone or download this repository
  2. Install dependencies:
pip install -r requirements.txt

Or if using a virtual environment (recommended):

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt

Usage

python png2splash.py <image.png>

Example

python png2splash.py splash.png

This will generate boot_splash_screen_notext.inc containing the C++ header file with the splash screen data.

Output

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 pixels
    • SplashScreenH - Height in pixels
  • Pixel data array SplashScreen[] in ARGB format
  • Static assertion to verify array size

Image Requirements

  • Format: PNG (with transparency support)
  • Maximum resolution: 1280x720 pixels (Nintendo Switch display resolution)
  • Images larger than the maximum will be rejected with an error

License

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.

About

Converts PNG files to match Atmosphères initial boot logo.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages