Skip to main content
DevPixelForge is distributed as source code. You build the Rust engine locally, then copy the resulting binary and the Go bridge files into your project.

System requirements

DependencyVersionPurpose
Rust≥ 1.74Compiles the dpf engine binary
Go≥ 1.23Builds the Go bridge and your project
musl-toolsany (Debian/Ubuntu)Required for static binary builds only
FFmpeg≥ 6.0Required for video and audio operations
Image-only workflows do not require FFmpeg. Install it only if you plan to use video_* or audio_* operations.
1

Install Rust

If you don’t have Rust installed, use rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustc --version
Verify you have at least version 1.74:
rustc --version
# rustc 1.74.0 (79e9716c9 2023-11-13) or newer
2

Install FFmpeg (for video and audio)

Install FFmpeg 6.0 or newer using your system package manager:
sudo apt install ffmpeg
ffmpeg -version
3

Clone the repository

Clone DevPixelForge from GitHub:
git clone https://github.com/GustavoGutierrez/devpixelforge.git
cd devpixelforge
The repository contains two main components:
devpixelforge/
├── dpf/            # Rust engine (produces the dpf binary)
└── go-bridge/      # Go client files to copy into your project
4

Build the engine

Run the full build to compile the Rust engine and the Go example:
make build
Or build components individually:
make build-rust
# Binary written to: dpf/target/release/dpf
The static binary (make build-rust-static) has zero runtime dependencies and runs on any x86-64 Linux distribution. Use it for containerized or serverless deployments.
The Rust release profile uses opt-level = 3, fat LTO, and codegen-units = 1 for maximum throughput. Expect the initial build to take 1–3 minutes.
5

Verify the installation

Confirm the binary works by printing its capability report:
./dpf/target/release/dpf caps
A successful response lists all supported operations, accepted formats, and engine metadata. If the command exits cleanly, the engine is ready to use.
6

Set up the Go client

Copy the dpf binary and the Go bridge files into your Go project:
# Create the target directories
mkdir -p bin internal/dpf

# Copy the Rust binary (choose the build that matches your environment)
cp devpixelforge/dpf/target/release/dpf ./bin/dpf
# — or, for the static build —
cp devpixelforge/dpf/target/x86_64-unknown-linux-musl/release/dpf ./bin/dpf

# Copy the Go client files
cp devpixelforge/go-bridge/dpf.go ./internal/dpf/
cp devpixelforge/go-bridge/job.go ./internal/dpf/
cp devpixelforge/go-bridge/video_job.go ./internal/dpf/
cp devpixelforge/go-bridge/audio_job.go ./internal/dpf/
Update the package declaration in each copied file to match your module path. The files use package dpf by default, which works if you place them in a directory named dpf.Your final project layout should look like this:
your-project/
├── bin/
│   └── dpf                 # Rust engine binary
├── internal/
│   └── dpf/
│       ├── dpf.go          # Main client (Client, StreamClient, convenience job types)
│       ├── job.go          # Image job types (CropJob, RotateJob, WatermarkJob, …)
│       ├── video_job.go    # Video job types
│       └── audio_job.go    # Audio job types
└── main.go
The Go client has no external dependencies beyond the standard library — no go get required.
7

Make your first call

Instantiate the client and run a resize operation to confirm end-to-end connectivity:
package main

import (
    "context"
    "fmt"
    "log"
    "your-project/internal/dpf"
)

func main() {
    client := dpf.NewClient("./bin/dpf")

    result, err := client.Resize(
        context.Background(),
        "image.png",
        "out",
        []uint32{320, 640},
    )
    if err != nil {
        log.Fatal(err)
    }

    fmt.Printf("success=%v elapsed=%dms outputs=%d\n",
        result.Success, result.ElapsedMs, len(result.Outputs))
}
Run it:
go run main.go
# success=true elapsed=42ms outputs=2

Choosing a client mode

The Go bridge exposes two clients. Choose based on your workload:
ClientHow it worksBest for
ClientSpawns a new dpf process per jobScripts, one-off tasks, simple integrations
StreamClientKeeps one dpf process alive; sends jobs over stdinServers, batch pipelines, high-throughput workloads
StreamClient eliminates process-spawn overhead on every call. It is thread-safe and intended for use cases where the binary is initialized once at startup and shared across goroutines:
sc, err := dpf.NewStreamClient("./bin/dpf")
if err != nil {
    log.Fatal(err)
}
defer sc.Close()
Always call sc.Close() when shutting down to cleanly terminate the Rust process and avoid zombie processes.

Timeout configuration

Both clients support configurable timeouts. The default is 30 seconds. Increase it for long video operations:
client := dpf.NewClient("./bin/dpf")
client.SetTimeout(5 * time.Minute) // suitable for video transcoding

Next steps

Quick Start

Process your first image with the CLI and Go client

Go integration guide

Patterns, error handling, and production best practices

Streaming client

Deep dive into the persistent process mode

Building from source

Advanced build options and cross-compilation

Build docs developers (and LLMs) love