Development tools extension for KeeperFX modding.
Features
Raw Image Viewer
- View .raw files: Opens 256×256 8-bit indexed
.raw image files used by KeeperFX
- Game palette: Automatically loads
data/palette.dat from 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)
.raw files must be exactly 65536 bytes (256×256 pixels)
Usage
- Open a KeeperFX workspace in VS Code
- Open any
.raw file (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
.raw file
- Loads the palette from
data/palette.dat in 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
Testing
To test the extension:
- Press F5 to launch the Extension Development Host
- In the new window, open a KeeperFX workspace
- Open a
.raw file to see the viewer in action
Known Limitations
- Only supports 256×256
.raw files (the standard size for KeeperFX lens overlays and mists)
- Requires
data/palette.dat in the workspace (falls back to grayscale if not found)
- Read-only viewer (no editing capabilities)
Extension Structure
src/extension.ts: Extension entry point, registers the custom editor
src/rawImageEditor.ts: Custom editor provider implementing the viewer logic
package.json: Declares the custom editor contribution for *.raw files
Release Notes
0.0.1
Initial release:
- Basic
.raw file viewing
- Palette loading from workspace
- Zoom controls
- Transparency support
| |