API Reference Overview
Img2Num provides bindings for multiple languages. Choose the one that fits your workflow:
| Language | Docs |
|---|---|
| JS API Reference | |
| C++ API Reference | |
| C API Reference | |
| Python API Reference |
Common Concepts Across All Bindings
All APIs share these core concepts:
- Bilateral Filtering — Smooths noise while preserving edges.
- K-Means Clustering — Reduces the palette to
krepresentative colors. - Contour Tracing — Detects boundaries between color clusters.
- B-spline Simplification — Fits smooth quadratic curves to contours.
Shared Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
sigma_spatial () | float | 3 | Bilateral spatial sigma |
sigma_range () | float | 50 | Bilateral range sigma |
num_colors / k () | int | 16 | Number of clusters |
max_iter | int | 100 | K-means iterations |
min_area | int | 100 | Minimum contour area |
color_space | int | 0 | 0 = CIE LAB, 1 = sRGB |