FileToByte is a utility that transforms any file into a compressed C-style array, ready to drop straight into C++ source for easy in-memory handling — handy for embedding fonts, icons, shaders, or any asset directly into a binary.
You can download the latest binaries from Releases.
- Enter an Array Name (the C symbol prefix) and the File Path to convert.
- Pick an output Encoding.
- Click Convert, then Copy to clipboard to grab the generated source.
The file is compressed with stb_compress before encoding, so the output stays
compact. The generated arrays match Dear ImGui's
AddFontFromMemoryCompressed*TTF loaders.
| Encoding | Output symbol | Notes |
|---|---|---|
| U8 (default) | unsigned char <name>_compressed_data[] |
Hex bytes (0x..); endianness-independent |
| U32 | unsigned int <name>_compressed_data[] |
0x........ words; endianness-dependent |
| Base85 | const char <name>_compressed_data_base85[] |
Smallest source; load via the Base85 loader |
FileToByte pulls in the VulkanWindow scaffold as a git submodule (which itself vendors GLFW, Dear ImGui, and VulkanMemoryAllocator), so clone recursively:
git clone --recursive https://github.com/gage-lodba/FileToByte.git
cd FileToByte
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config ReleaseAlready cloned without --recursive? Fetch the submodules first:
git submodule update --init --recursiveThe binary is written to build/FileToByte (Linux) or
build/Release/FileToByte.exe (Windows).
- CMake ≥ 3.12
- A C++23 compiler (GCC, Clang, or MSVC)
- The Vulkan SDK — or system Vulkan headers + loader
GLFW, Dear ImGui, and VulkanMemoryAllocator come in transitively through the VulkanWindow submodule, so there's nothing else to install.
