API Reference
Complete API reference for the VIESUS Node.js native module — MyViesusObject constructor, Enhance method, error codes, and result JSON.
Import
const viesus = require('viesus');new viesus.MyViesusObject(guid)
Creates and initializes a VIESUS enhancer instance. Create one object per worker thread and reuse it across multiple Enhance() calls — initialization is expensive.
guid
string
Your VIESUS license GUID
const viesusObj = new viesus.MyViesusObject('4e8f35ab-7f72-4b1e-a1fd-2b5e9c58e9d3');viesusObj.Enhance(fromPath, toPath, iniPath, resPath)
Enhances a single image. Synchronous — must be called from a worker thread, not the main thread.
fromPath
string
Absolute path to the input image
toPath
string
Absolute path for the enhanced output image
iniPath
string
Absolute path to the viesusini.json configuration file
resPath
string
Absolute path for the result JSON output file
Returns: number
> 0— success; value is processing time in milliseconds< 0— error; see error codes
Error codes
-1
Init failed
-2
GUID wrong
-3
Internal error
-4
Loading image not possible
-5
Can't open file
-6
File not found
-7
File is empty
-8
Memory open internal error
-9
Enhancement failed — contact info@viesus.com
-10
Parameter file not found
-11
Parameter file empty
-12
Output format not supported
-13
Error writing result file
-126
Enhancement failed — image was already enhanced
-378
Wrong GUID
< -18
Internal error — contact info@viesus.com
Result JSON
When WriteResultFiles: 1 is set in viesusini.json, a JSON file is written to resPath after each enhancement with per-image processing details:
brightCorrStrength
float
Applied brightness correction strength
colorCorrStrength
float
Applied color correction strength
fdApplied
int
1 if face detection ran
ieApplied
int
1 if image enhancement ran
isArtificial
int
1 if image was classified as artificial/synthetic
isMonochrome
int
1 if image was detected as monochrome
locShpApplied
int
1 if local sharpening was applied
rszApplied
int
1 if resizing was applied
rszSRApplied
int
1 if AI upscaling was used for resize
arApplied
int
1 if artifact removal was applied
bgApplied
int
1 if background handling was applied
Thread pool pattern
The recommended production pattern uses node-worker-threads-pool:
See Getting Started for the complete example.
Last updated
Was this helpful?
