crf2html
is a command-line utility inspired by the Thief series of video games, including Thief: The Dark Project, Thief Gold and Thief II: The Metal Age. In these classic games, textures and images were stored in proprietary formats like CRF and PCX. The tool aims to bring a piece of that nostalgic world to modern web development.
The program is designed to generate an HTML page that beautifully showcases the textures found in Thief series CRF files and other image formats (.pcx
, .gif
, .png
, .jpg
, and .tga
). It seamlessly resizes and encodes these textures as base64, making it easy to embed them in an organized HTML page.
Whether you're a fan of the Thief series or simply interested in working with these classic texture formats, crf2html
provides a convenient way to create galleries and showcases of these vintage textures for various creative and nostalgic purposes.
The project primarily draws inspiration from /vfig/thieftextures, which is a Python program.
- Read image files from both directories and CRF/ZIP files.
- Supports multiple image formats including
.pcx
,.gif
,.png
,.jpg
, and.tga
. - Ability to resize images and encode them as base64 for inline embedding in HTML.
- Organizes images by families, based on their directory or path structure.
- Easily customizable output through command-line arguments.
You can download a precompiled binary for your platform from the releases section of this repository.
Important
It is recommended to install and use at least Go v1.21. Here are the corresponding instructions.
If you prefer to compile the program yourself, follow these steps:
-
Clone this repository to your local machine:
git clone https://github.com/jonathanlinat/crf2html.git
-
Change to the project directory:
cd crf2html
-
Build the program:
go build crf2html.go
This will generate a binary, crf2html
or crf2html.exe
, in the project directory.
source_path
: Path to the directory containing image files or a CRF/ZIP file.output_path
: Path to the HTML file to be generated.-title "Page Title"
(optional): Custom title for the HTML page. If not provided, the default title isTextures
.-size 64
(optional): Custom thumbnail size for the HTML page. If not provided, the default size is128
.
./crf2html source_path output_path [-title "Page Title"]
crf2html.exe source_path output_path [-title "Page Title"]
Here's an example of how to use crf2html
to create an HTML page:
./crf2html ./fam.crf ./textures.html -title "My Custom Title" -size 64
crf2html.exe C:\path\to\source\fam.crf C:\path\to\output\textures.html -title "My Custom Title" -size 64
This command will generate an HTML page named textures.html
in the current directory, showcasing the image textures from the fam.crf
source, with the custom title My Custom Title
.
This project is licensed under the MIT License. See the LICENSE file for details.
crf2html
uses the following third-party Go packages:
- nfnt/resize for image resizing.
- samuel/go-pcx/pcx for PCX image format support.
Feel free to contribute to this project, report issues, or suggest improvements!