This project is a Rust implementation of a high-performance NFT Marker Creator for WebARKit. It provides powerful tools to generate Natural Feature Tracking (NFT) markers that can be used in augmented reality applications.
✨ Key Features:
- Universal Compatibility: Generates NFT markers from images and exports them in a format compatible with a wide range of AR frameworks based on WebARKitLib, ARtoolKit5, and ARToolKitX (including ARnft, JsartoolkitNFT, Jsartoolkit5, and AR.js).
- Core Reliability: Built on top of the robust
webarkitlib-rscrate for reliable core marker generation functionality. - Friendly GUI: Includes an intuitive graphical interface built with
eframeandegui_extrasfor user-friendly interaction. - Cross-Platform: Designed to run seamlessly on Windows, macOS, and Linux.
🚀 The package now ships both as:
- 🖥️ A standalone desktop application binary
- 📦 A reusable Rust library
This project uses a C++ back-end (via webarkitlib-rs) for feature extraction. To build it, you need:
- 🦀 Rust: Latest stable version.
- ⚙️ C++ Toolchain: A C++17 compatible compiler (MSVC on Windows, Clang/GCC on macOS/Linux).
- 🛠️ CMake: Required for building the FFI bindings.
-
Clone the repository:
git clone https://github.com/webarkit/webarkit-nft-forge-rs.git cd webarkit-nft-forge-rs -
Build the project using Cargo. You can use the
ffi-backendfeature for C++ marker generation:cargo build --release --features ffi-backend
Optional features: You can also enable SIMD optimizations and logging helpers by passing additional features:
cargo build --release --features ffi-backend,simd,log-helpers
-
Run the application:
cargo run --release --features ffi-backend
Or with all features:
cargo run --release --features ffi-backend,simd,log-helpers
The application provides a user-friendly interface for generating NFT markers:
- 🖼️ Select Image: Click "📁 Select Image" to choose a source JPG or PNG file.
- 📁 Output Directory: Optionally select where to save the markers. Defaults to the current directory.
- 🏷️ Marker Name: Provide a semantic name for your marker files.
- 🎚️ DPI Setting: Use the slider to set the source image DPI (default 72, range 72-600).
- 🚀 Generate: Click "🚀 Generate Marker". The process runs in the background, and you can monitor progress via the status bar.
The tool generates three files per marker:
- 📄
.iset: Image set metadata. - 📉
.fset: Feature set data. - 🧩
.fset3: KPM/FREAK feature data (required for NFT).
You can also use the core functionality as a library in your own Rust projects:
use std::sync::Arc;
use std::sync::atomic::AtomicU32;
use webarkit_nft_forge_rs::generate_nft_marker;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let image_data = std::fs::read("input.jpg")?;
let output_dir = std::path::Path::new("./output");
let progress = Arc::new(AtomicU32::new(0));
generate_nft_marker(
&image_data,
1920, 1080, 3, // width, height, channels
output_dir,
"my_marker",
72.0, // DPI
Some(progress)
)?;
Ok(())
}This project is licensed under the LGPL-3.0-or-later.