https://github.com/Cerwym/keeperfx-devtools
Started out as a way to view the RAW file data so I could see what I was doing when adding overlay support to lenses.
Features
Raw Image Viewer
- View .raw files: Opens 256×256 8-bit indexed
.rawimage files used by KeeperFX - Game palette: Automatically loads
data/palette.datfrom your workspace to display images with correct colors - Transparency support: Shows color index 0 as transparent with a checkerboard background
- Zoom controls: Fit, 100%, 200%, 400%, and 800% zoom levels
- Pixel-perfect rendering: Uses nearest-neighbor scaling to preserve sharp pixels
Requirements
- A KeeperFX workspace containing
data/palette.dat(768 bytes: 256 colors × RGB with 6-bit values) .rawfiles must be exactly 65536 bytes (256×256 pixels)
Usage
- Open a KeeperFX workspace in VS Code
- Open any
.rawfile (e.g.,config/mods/your-mod/data/overlay_test.raw) - The custom viewer will automatically open showing the image with the correct palette
- Use the toolbar buttons to zoom in/out
How It Works
- Reads the 256×256 indexed pixel data from the
.rawfile - Loads the palette from
data/palette.datin your workspace - Converts 6-bit RGB palette values (0-63) to 8-bit (0-255) by multiplying by 4
- Maps each pixel's color index to RGB using the palette
- Renders transparency (color 0) with checkerboard background
- Displays the result in a webview canvas with zoom controls
Known Limitations
- Only supports 256×256
.rawfiles (the standard size for KeeperFX lens overlays and mists) - Requires
data/palette.datin the workspace (falls back to grayscale if not found) - Read-only viewer (no editing capabilities)
