Skip to content

webarkit/Nft-Marker-Creator-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

183 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

github releases github stars github forks npm package version PyPI version docker pulls CI Build Nft-Marker-Creator-App

Nft-Marker-Creator-App

This editor creates NFT markers for WebARKitLib and ARTOOLKIT 5.x, they are compatible with jsartoolkitNFT.js, jsartoolkit5.js, artoolkit5.js, ARnft.js and AR.js. A Node app and a native Python package (on PyPI) are provided β€” jump to the Python package section for pip install nft-marker-creator.

This project is based on the original NFT Marker Creator by Carnaux but has been updated to work with the latest versions of Node and NPM, and also to work with the latest version of Emscripten, plus other improvements.

Now with threading support!! Read more in Run the app section

Quick start ⚑

cd src
node NFTMarkerCreator.js -i PATH/TO/IMAGE --threaded <number_of_threads>

Example:

cd src
node NFTMarkerCreator.js -i pinball.jpg --threaded 8

Outputs land in src/output. See the sections below for setup, flags, and optional demo steps.

Prerequisites βœ…

  • Tested on Windows 11 (PowerShell 5.1) and Ubuntu 22.04 LTS (bash)
  • Git 2.39+
  • Node.js v22.21.1 (.nvmrc, Node 22 LTS; minimum supported >=20.17.0) and npm 10+
  • nvm 0.39+ (optional but recommended for managing Node versions)
  • Docker 24+ (required only for the containerised build flow)

Node app

Installation πŸ“¦

  1. Clone this repository (or download the latest prebuilt NFTMarkerCreator.js and build/ bundle from the GitHub Releases page).
  2. Install Node via nvm (recommended):
    • nvm install
    • nvm use 22
  3. Install dependencies: npm install

Run the app πŸš€

  1. Place the image you want to convert inside the src folder (either directly or inside a subfolder).
  2. Generate the marker:
 cd src
 node NFTMarkerCreator.js -i PATH/TO/IMAGE

Example:

cd src
node NFTMarkerCreator.js -i pinball.jpg

The output files are saved in the src/output directory. Use --threaded <count> to speed up processing; start with the number of physical CPU cores and adjust based on thermals and available memory (e.g., laptops may peak at 4 threads, workstations can push higher):

cd src
node NFTMarkerCreator.js -i PATH/TO/IMAGE --threaded <number_of_threads>

Example:

cd src
node NFTMarkerCreator.js -i pinball.jpg --threaded 4

CLI flags βš™οΈ

Example: node NFTMarkerCreator.js -i image.png -level=4 -min_thresh=8

Flag Description Default
-zft Create only the .zft file β€”
-noConf Skip the confidence confirmation prompt β€”
-Demo Generate the demo configuration alongside the marker β€”
-level=n Feature density preset from 0 (few) to 4 (many) 2
-sd_thresh=<value> Override standard deviation threshold Auto
-max_thresh=<value> Override maximum feature threshold Auto
-min_thresh=<value> Override minimum feature threshold Auto
-leveli=n Initial feature density preset from 0 to 3 1
-feature_density=<value> Manual feature density multiplier Auto
-dpi=f Force a DPI value instead of the embedded JPEG DPI Image metadata
-max_dpi=<value> Cap the maximum DPI processed for multi-scale markers Auto
-min_dpi=<value> Floor the minimum DPI processed for multi-scale markers Auto
-background Run detached in the background (macOS/Linux only) β€”
--help, -h, -? Print CLI usage information β€”
--threaded <n> Run feature extraction using n threads 1
-nofset / -fset Disable or force generation of the .fset file Enabled
-nofset3 / -fset3 Disable or force generation of the .fset3 file Enabled

Demo πŸ§ͺ (optional)

  • npm run demo
  • Open http://localhost:3000/
  • Add -Demo to the marker command to generate demo assets automatically: node NFTMarkerCreator.js -i image.png -Demo

Python package (PyPI) 🐍

A native Python package β€” a pybind11 binding around the same WebARKitLib core as the Node app β€” is published on PyPI with prebuilt wheels, so no compiler or Docker is required.

Wheels are provided for Linux (manylinux) and Windows (AMD64), CPython 3.8–3.13.

Installation πŸ“¦

pip install nft-marker-creator

CLI πŸš€

nft-marker-creator -i pinball.jpg -o ./markers --threads 4

This writes <name>.iset, <name>.fset and <name>.fset3 to the output directory. Output is byte-identical regardless of thread count.

Flag Description Default
-i, --input Input image (jpg/jpeg/png) required
-o, --output Output directory current dir
--dpi Force a DPI instead of image metadata metadata, else 150
--level Tracking extraction level 0–4 2
--leveli Initialization extraction level 0–3 1
--threads Worker threads for feature extraction 1
-h, --help Print CLI usage information β€”

Python API 🐍

import nft_marker_creator as nmc

paths = nmc.create("pinball.jpg", output_dir="markers", threads=4)
print(paths)  # ['markers/pinball.iset', 'markers/pinball.fset', 'markers/pinball.fset3']

See python/README.md for the full API and details.

Additional resources πŸ“š

ES6 version of the build library

The library is built with Emscripten and is located in the build folder. It is an ES6 module and can be imported in your project.

<script type="module">

  import nftMC from '../build/NFTMarkerCreator_ES6_wasm.js';
  const mc = await nftMC();

</script>

Create your NTS markers with our docker image

First, you need docker installed in your system, if you haven't, follow the Docker engine installation instruction . Then inside the folder you want to run the docker image:

Linux/macOS:

docker run -dit --name nft-app -v "$(pwd):/src" webarkit/nft-marker-creator-app:0.4.0 bash

Windows (PowerShell):

docker run -dit --name nft-app -v "${PWD}:/src" webarkit/nft-marker-creator-app:0.4.0 bash

With the docker container generate the NFT marker:

docker exec nft-app node ../Nft-Marker-Creator-App/src/NFTMarkerCreator.js -I /src/pinball.jpg

remember to prepend the -I /src/<path to your image>

Build

Build emscripten files with docker:

Linux/macOS:

docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) -e "EMSCRIPTEN=/emsdk/upstream/emscripten" emscripten/emsdk:4.0.19 npm run build-local

Windows (PowerShell):

docker run --rm -v "${PWD}:/src" -e "EMSCRIPTEN=/emsdk/upstream/emscripten" emscripten/emsdk:4.0.19 npm run build-local

or better create a docker container and run the build command inside it:

Linux/macOS:

docker run -dit --name emscripten-nft-marker-creator-app -v $(pwd):/src emscripten/emsdk:4.0.19 bash
docker exec emscripten-nft-marker-creator-app npm run build-local

Windows (PowerShell):

docker run -dit --name emscripten-nft-marker-creator-app -v "${PWD}:/src" emscripten/emsdk:4.0.19 bash
docker exec emscripten-nft-marker-creator-app npm run build-local

In VSCode you can run the setup-docker and build-docker command inside package.json.

Planned Features

  • Multi threading support to speed up the creation of the markers.
  • Python version of the project and app. β€” published on PyPI πŸŽ‰

About

Improved NFT-Marker-Creator app to create your NFT markers for all compatible WebAR projects.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors