Generate a high-shape-count livery JSON for Forza Horizon 5 in a fraction of the CPU time using your machine's GPU.
Produce reproducible runs for sharing or benchmarking by passing a fixed RNG seed on the command line.
Inspect intermediate quality by writing the preview PNG alongside the JSON output.
Plug the generated JSON back into the user's normal forza-painter branch for FH4, FH5, or FH6.
Requires Go 1.24 plus OpenCL-SDK 3.0.19 and CGO build flags that the README only spells out for Windows; Linux and macOS users must port the PowerShell script themselves.
This is a third-party helper tool for a project called forza-painter, which lets people paint custom liveries (the decals and color schemes on cars) in the Forza racing games. The forza-painter project takes a target image and converts it into a list of geometric shapes that the game can reproduce in its livery editor. This repository, written by zjl88858, rebuilds part of that conversion step so the JSON file describing those shapes is generated more quickly, letting users get a higher-quality livery in the same amount of time. The main difference from the original project is that this version uses the GPU instead of the CPU for the heavy math. It calls OpenCL through the OpenCL-SDK library to do error calculations and to rasterize shapes on the graphics card. To keep things simple it only renders rotated ellipses, which is the one shape that forza-painter actually needs. It also keeps the transparent pixels of a PNG image intact, evaluates many candidate shapes in parallel, and avoids recomputing the error for the whole image each time a shape is added. The code is written in Go with CGO, so once it is compiled it can ship as a single binary on different platforms without needing a runtime. The README lists Go 1.24 or newer and OpenCL-SDK 3.0.19 or newer as requirements, and includes a PowerShell script for building on Windows. Linux and macOS users are pointed at the script as a reference for setting their compiler flags. Usage is through a command line tool. The user passes an input image plus optional flags for the output path, a preview PNG, a settings ini file, a profile name, and an RNG seed for reproducible runs. The program prints progress as it works and writes JSON files at the shape counts listed in the settings. The generated JSON is then imported back into the user's normal forza-painter branch (links are given for FH4, FH5, and FH6) to load the livery into the game. The README includes a short performance table comparing CPU and OpenCL times per ellipse on a laptop iGPU and on a Ryzen AI MAX 395 machine, showing large speedups on the GPU path. The author also notes that generative AI was used to help plan the work, write some of the code, and translate the non-Chinese version of the document.
Generated 2026-05-22 · Model: sonnet-4-6 · Verify against the repo before relying on details.