8000 GitHub - llortus/lumpy: Command-line tool to convert between PNG images and Quake .lmp / gfx.wad graphics. Pure Python, no dependencies. · GitHub
[go: up one dir, main page]

Skip to content
llortusPublic

About

Command-line tool to convert between PNG images and Quake .lmp / gfx.wad graphics. Pure Python, no dependencies.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lumpy

A small command-line tool for converting between PNG images and Quake's 8-bit graphics formats: loose picture .lmp files and the gfx.wad (WAD2) archive.

It is a single Python script with no dependencies beyond the standard library.

Requirements

  • Python 3

Usage

python3 lumpy.py pic      image.png      out.lmp    # one PNG -> picture .lmp
python3 lumpy.py wad      pics/          gfx.wad    # every PNG in a folder -> wad
python3 lumpy.py wad      conchars.png   gfx.wad    # or a single PNG
python3 lumpy.py extract  gfx.wad        outdir/    # .wad or .lmp -> PNGs

pic

Converts one PNG into a Quake picture lump (width/height header followed by palette indices). Use it for loose menu art, conback.lmp, and similar files under gfx/.

wad

Builds or updates a WAD2 file from a folder of PNGs, or from a single PNG. Each PNG becomes one lump named after the file (lowercased, at most 15 characters).

If the wad already exists, lumpy updates it in place: a PNG replaces the lump with the same name, or is added as a new lump, and every other lump is kept unchanged. The new wad is written to a temporary file first, so a failed run leaves the original intact.

lumpy warns if the result has no conchars lump, because the engine will not start without it.

extract

Turns a .wad or .lmp back into palette PNGs.

  • From a wad, every picture lump and conchars is extracted. Compressed lumps and lumps of other types are skipped.
  • palette.lmp is extracted as a 16x16 image, one pixel per colour.
  • colormap.lmp is extracted as a 256x64 image, one row per light level.
  • Any other .lmp is treated as a picture.

Choosing a palette

By default lumpy uses palette.lmp next to the script, which is id's original Quake palette. To use a different one, pass --palette before the command:

python3 lumpy.py --palette mymod/gfx/palette.lmp wad pics/ gfx.wad

How colours are converted

Quake pictures store one palette index per pixel, so every PNG colour is matched to the nearest palette colour (by RGB distance). Exact matches are used as is; lumpy reports how many pixels in each image needed approximating.

  • Pixels with alpha below 128 become transparent (index 255).
  • Opaque pixels never use index 255.

The console font (conchars)

conchars.png is special:

  • It must be exactly 128x128 (16x16 characters of 8x8 pixels).
  • It is stored without a size header, and only inside gfx.wad (the pic command refuses it).
  • The engine treats both index 0 (black) and index 255 as transparent in the font, so opaque black pixels are drawn with the nearest non-black colour. When extracted, both indices come out transparent.

Supported PNGs

PNGs must be 8 bits per channel (greyscale, RGB, or with alpha) or a palette image (1, 2, 4 or 8 bit), and must not be interlaced. This covers what image editors normally export. 16-bit or interlaced images are rejected with a message asking you to re-save them.

Files

File Purpose
lumpy.py The tool.
palette.lmp id's original Quake palette, used by default.
palette.png The same palette as an image, for reference in editors.

License

GNU General Public License, version 2 or (at your option) any later version. Copyright (C) 2026 Llortus. See COPYING.txt for the full license text.

About

Command-line tool to convert between PNG images and Quake .lmp / gfx.wad graphics. Pure Python, no dependencies.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0