Package Exports
- @webarkit/nft-marker-creator-app
- @webarkit/nft-marker-creator-app/src/NFTMarkerCreator.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@webarkit/nft-marker-creator-app) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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 is provided.
Check out the wiki to learn how to generate good markers! https://github.com/Carnaux/NFT-Marker-Creator/wiki/Creating-good-markers
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.
Node app
How to use it
Clone this repository.
Install all dependencies. First run
nvm installit will download the node version specified in the
.nvmrcfile. You need to install nvm first if you don't have it. Then runnvm use 18to use the node version specified in the.nvmrcfile.Then finally run
npm installPut the image you want inside the
srcfolder. You can just paste it or you can create a folder. e.g- NFTmarkerCreatorAppFolder
- NFTMarkerCreator.js
- IMAGE.PNG ⬅️
- ...
or
- NFTmarkerCreatorAppFolder
- NFTMarkerCreator.js
- FOLDER/IMAGE.PNG ⬅️
- ...
- NFTmarkerCreatorAppFolder
Run it
node NFTMarkerCreator.js -i PATH/TO/IMAGEIn the end of the process an "output" folder will be created(if it does not exist) with the marker files.
You can use additional flags with the run command.
e.g node app.js -i image.png -level=4 -min_thresh=8
-zft
Flag for creating only the zft file
-noConf
Disable confirmation after the confidence level
-Demo
Creates the demo configuration
-level=n
(n is an integer in range 0 (few) to 4 (many). Default 2.'
-sd_thresh=<sd_thresh>
-max_thresh=<max_thresh>
-min_thresh=<min_thresh>
-leveli=n
(n is an integer in range 0 (few) to 3 (many). Default 1.'
-feature_density=<feature_density>
-dpi=f:
Override embedded JPEG DPI value.
-max_dpi=<max_dpi>
-min_dpi=<min_dpi>
-background
Run in background, i.e. as daemon detached from controlling terminal. (macOS and Linux only.)
--help -h -?
Display this helpThe generated files will be on the "output" folder.
(OPTIONAL) You can test your marker using the demo folder!
Just run
npm run demo.It should open a server at: http://localhost:3000/
If you want to create the demo configuration when you create a marker, add
-Demoto the command parameters.e.g node app.js -i image.png -Demo
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 docker:
docker run -dit --name nft-app -v "$(pwd):/src" nft-marker-creator-app:0.2.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:
docker run --rm -v $(pwd):/src -u $(id -u):$(id -g) -e "EMSCRIPTEN=/emsdk/upstream/emscripten" emscripten/emsdk:3.1.26 npm run build-localor better create a docker container and run the build command inside it:
docker run -dit --name emscripten-nft-marker-creator-app -v $(pwd):/src emscripten/emsdk:3.1.26 bash
docker exec emscripten-nft-marker-creator-app npm run build-localPlanned Features
- Multi threading support to speed up the creation of the markers.