Skip to content

tschak909/ilbmview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ilbmview

A small, dependency-light viewer for classic Commodore-Amiga IFF ILBM (Interleaved Bitmap) images, rendered in a native Wayland window. Built for a tiling setup (Hyprland): the image auto-scales to the window while preserving aspect ratio, and closing the window quits the program.

It fully honours the CAMG viewport mode so images display with the correct geometry and palette, including HAM, Extra-Half-Brite, hi-res and interlace.

Features

  • Parses IFF ILBM: BMHD, CMAP, CAMG, BODY (unknown chunks are skipped).
  • ByteRun1 (PackBits) compression and uncompressed BODY.
  • Display modes:
    • Plain indexed, 1–8 bitplanes
    • EHB (Extra-Half-Brite), 6 planes / 64 colours
    • HAM6 (OCS, 4096 colours) and HAM8 (AGA)
    • 24-bit / 32-bit deep (direct RGB) ILBM
  • Palette handling: OCS 12-bit palettes (4-bit-per-gun stored in the high nibble) are expanded to full range; CAMG garbage bits are sanitised and cross-validated against the plane count.
  • Authentic Amiga pixel aspect: uses the BMHD aspect fields when present, otherwise derives from CAMG hi-res/interlace. The image is fitted into the window with correct proportions and black letterbox/pillarbox bars.
  • Nearest-neighbour scaling (crisp pixels), re-scaled live on window resize.
  • Quit by closing the window, or pressing Esc / q.

Dependencies

  • libwayland-client
  • wayland-scanner + wayland-protocols (for xdg-shell, used at build time)
  • gcc, make, pkg-config

No SDL, GTK, cairo, EGL or xkbcommon. Rendering is pure software via wl_shm.

Build

make

This generates the xdg-shell client glue with wayland-scanner and produces ./ilbmview.

Usage

./ilbmview picture.ilbm

The window can be tiled or floated like any other Wayland toplevel (app-id ilbmview). Resize it and the image rescales to fit.

Install & file associations

make install installs the binary to $(PREFIX)/bin (default ~/.local) and a .desktop handler that declares the image/x-ilbm MIME type, then refreshes the desktop database:

make install                 # user install to ~/.local
sudo make install PREFIX=/usr/local   # or a system-wide install

Make it the default viewer for ILBM files (*.ilbm, *.lbm, *.iff):

xdg-mime default ilbmview.desktop image/x-ilbm

That is all Nautilus (and anything GIO-based, including gio open) needs: GIO recognises the image/x-ilbm type from the file extension and will launch ilbmview on double-click.

xdg-open note (non-GNOME/KDE sessions such as Hyprland/Sway): the generic xdg-mime detector falls back to file --mime-type, which reports ILBM files as application/octet-stream, so xdg-open won't route them by itself. Install a glob-aware detector to fix it:

sudo pacman -S perl-file-mimeinfo   # provides `mimetype`, used by xdg-mime

After that, xdg-mime query filetype picture.ilbm returns image/x-ilbm and xdg-open picture.ilbm opens ilbmview. (gio open picture.ilbm works without this.)

To undo everything: make uninstall, and remove the image/x-ilbm line from ~/.config/mimeapps.list.

Thumbnails & metadata columns in Nautilus

make install also sets up two optional Nautilus integrations:

  • Thumbnails. A .thumbnailer maps image/x-ilbm to ilbm-thumbnail, a tiny headless tool (built alongside ilbmview, no Wayland/libpng needed — it uses the same decoder and a self-contained PNG writer). Nautilus then shows correctly-decoded ILBM previews — HAM/EHB colours and Amiga pixel aspect and all.
  • Metadata columns. A nautilus-python extension adds Dimensions, Amiga Mode (e.g. HAM6 · interlaced), Bit-planes and Compression columns. Enable them per-folder via list view → the column header context menu, or globally in Nautilus Preferences. It reads only the IFF header, so it is cheap.

After installing, restart Nautilus so it loads them:

nautilus -q     # the running instance respawns on next use

ilbm-thumbnail is also usable on its own: ilbm-thumbnail in.ilbm out.png 512.

Not (yet) supported

  • Dynamic per-scanline palettes (SHAM / CTBL / PCHG copper-list colour changes) and colour cycling (CRNG / CCRT).
  • Transparency / masking compositing — the mask plane is parsed and skipped; images render as opaque single frames.

Layout

src/iff.{c,h}   IFF chunk walker + ILBM field extraction
src/ilbm.{c,h}  bitplane decode, all CAMG modes, aspect calculation
src/wl.{c,h}    Wayland wl_shm/xdg-shell client, scaler, input
src/main.c      CLI glue

License

Copyright (C) 2026 Thomas Cherryhomes.

ilbmview is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License, version 3 or later (GPL-3.0-or-later), as published by the Free Software Foundation. See LICENSE for the full text. It comes with NO WARRANTY, to the extent permitted by law.

About

A Commodore-Amiga IFF ILBM viewer for Wayland

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors