Skip to documentation content

Image Formats & PNG Color Depth

Which image formats GNU GRUB 2 accepts, why 8-bit per channel PNG is mandatory, and how to avoid silent load failures.

Why images sometimes fail to load in GRUB 2

GRUB 2 runs in a minimal pre-OS environment with tiny built-in image decoders (grub_video_reader_png, grub_video_reader_jpeg, and grub_video_reader_tga). Unlike desktop image viewers or web browsers, GRUB does not fall back to heavy color-management libraries — if a file uses an unsupported bit depth or encoding mode, GRUB silently skips it.

SupportedAlpha transparency: Supported (RGBA)

GRUB 2 gfxmenu behavior

Ideal default format. Decoded natively by png.c (color_type 6) with full 256-level alpha blending for 9-slices, icons, and overlays.

Recommended export setting

Export as 8 bits/channel (32-bit RGBA), non-interlaced, sRGB.

Interactive GRUB 2 image format and PNG color-depth compatibility matrix

Accepted image formats in GRUB 2

Format Extensions Transparency (Alpha) Recommended Use Key Limitation
PNG .png Full 8-bit alpha (RGBA) Default choice for 9-slices, icons, overlays, and backgrounds Must be 8 bits/channel (never 16-bit); avoid interlaced PNGs
JPEG .jpg, .jpeg None (opaque RGB only) Full-screen photographic wallpapers when disk space is tight Baseline DCT only — Progressive JPEG and CMYK fail to load
TGA .tga Optional 8-bit alpha (32-bit) Legacy themes and uncompressed sprites Much larger file sizes than PNG

PNG color depth, color type, and interlacing (png.c rules)

Knowing the exact checks inside grub-core/video/readers/png.c explains why valid-looking PNG files sometimes fail at boot:

  • 8 bits per channel RGB (24-bit total) / RGBA (32-bit total), non-interlaced — USE THIS: Every channel (R, G, B, and optional A) uses an 8-bit integer (0–255). This matches GRUB's framebuffer natively and works across all versions and hardware.
  • Indexed / Palette PNG (color_type = 3, e.g., PNG-8 optimizers) — REJECTED: GRUB's png.c only decodes truecolor RGB (2), RGBA (6), and grayscale (0/4), throwing png: color type not supported on palette-indexed PNGs. Always export truecolor 8-bit RGBA for UI elements and 9-Slice Boxes.
  • Interlaced PNG (Adam7) — REJECTED: GRUB explicitly rejects interlaced PNGs with png: interlace method not supported. Always export non-interlaced.
  • 16 bits per channel (48-bit RGB / 64-bit RGBA) — DISCOURAGED: Recent GRUB 2 builds (2.06 / 2.12) downsample 16-bit channels to 8-bit on the fly, but older builds reject them and 16-bit files roughly double disk and decode cost in /boot with zero visual gain.

Quick verification with file or ImageMagick

Before shipping a theme, you can inspect any PNG from your terminal (Linux and macOS, or Windows via WSL / Git Bash):

check-png.sh
        
          
            # Check bit depth and color type (Linux / macOS / WSL)
          
            file background.png menu_nw.png
          
            
          
            # Good output looks like:
          
            # background.png: PNG image data, 1920 x 1080, 8-bit/color RGB, non-interlaced
          
            # menu_nw.png:    PNG image data, 16 x 16, 8-bit/color RGBA, non-interlaced
          
        
      

If a file reports 16-bit/color, colormap (indexed), or interlaced, convert it cleanly to 8-bit non-interlaced RGBA with ImageMagick (Linux, macOS, and Windows):

convert-to-8bit.sh
        
          
            # Convert 16-bit or indexed PNG into safe 8-bit RGBA for GRUB 2
          
            magick input.png -depth 8 -interlace none PNG32:output.png
          
            
          
            # Convert progressive JPEG into baseline JPEG (or directly to 8-bit PNG)
          
            magick wallpaper.jpg -interlace none -colorspace sRGB wallpaper-baseline.jpg