Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ ENV EMSDK=$EMSDK_DIR
# Auto-load emsdk in all shells
RUN echo "source /opt/emsdk/emsdk_env.sh" >> /etc/bash.bashrc

RUN chown -R dev:dev /opt/emsdk/
# --------------------------------------------------------------------------------------------------------------
# Dawn dependencies
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Try the [live demo](https://ryan-millard.github.io/Img2Num/)!
- [C++](https://ryan-millard.github.io/Img2Num/info/docs/next/cpp/)
- [C](https://ryan-millard.github.io/Img2Num/info/docs/next/c/)
- [JavaScript](https://ryan-millard.github.io/Img2Num/info/docs/next/js/)
- [Python](https://ryan-millard.github.io/Img2Num/info/docs/next/python/)
- [Internal docs](https://ryan-millard.github.io/Img2Num/info/docs/next/internal/) (for contributors)

### Community
Expand Down
1 change: 0 additions & 1 deletion bindings/c/include/cimg2num.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ extern "C" {
/// @brief Configuration options for image_to_svg.
/// @ingroup CIMG2NUM_H
typedef struct img2num_ImageToSvgConfig {

/// Configuration settings for the bilateral filter in image_to_svg.
struct BilateralFilterConfig {
/// Standard deviation for spatial Gaussian (proximity weight).
Expand Down
3 changes: 1 addition & 2 deletions bindings/c/src/cimg2num.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ char* img2num_image_to_svg(
}
std::memcpy(result, svg.c_str(), svg.size() + 1);
},
data, width, height
);
data, width, height);

return result;
}
Expand Down
2 changes: 1 addition & 1 deletion bindings/js/doxygen/home_page.dox
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* To build the JavaScript/WASM bindings, follow these steps:
*
* \code{.sh}
* emcmake cmake -B build-wasm
* emcmake cmake -DCMAKE_BUILD_TYPE=Release -B build-wasm
* cmake --build build-wasm
* \endcode
*
Expand Down
14 changes: 14 additions & 0 deletions bindings/py/Doxyfile.internal
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@INCLUDE = ../../doxygen/Doxyfile.base

PROJECT_NAME = "Img2Num Python Bindings (Internal Developer Docs)"

PROJECT_NUMBER = dev

INPUT = src ../../doxygen/*.dox doxygen/home_page.dox
OUTPUT_DIRECTORY = ../../docs/static/docs/internal/bindings/py/api

RECURSIVE = YES

EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
INTERNAL_DOCS = YES
95 changes: 95 additions & 0 deletions bindings/py/doxygen/home_page.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/*! \mainpage Img2Num Python Bindings
*
* \section intro_sec Introduction
*
* The **Img2Num Python Bindings** provide a Python interface to the core Img2Num
* image processing library via pybind11. These bindings wrap the underlying C++
* functionality, exposing image processing operations such as filtering, clustering,
* thresholding, and SVG conversion to Python code.
*
* All functions operate on `numpy.ndarray` buffers and return new image data, making
* them easy to integrate into Python-based image processing pipelines.
*
* \section features_sec Key Features
*
* The Python bindings expose the following core capabilities:
* - **FFT-based Gaussian blur** — Fast frequency-domain blurring
* - **Image inversion** — Invert pixel values
* - **Thresholding** — Standard and black-thresholding operations
* - **K-means clustering** — Pixel clustering for color quantization
* - **Bilateral filtering** — Edge-preserving smoothing
* - **Label-to-SVG conversion** — Convert labeled images to SVG strings
* - **Image-to-SVG conversion** — Full image vectorization with configurable parameters
* - **ImageToSvgConfig** — Python-accessible configuration for SVG generation
*
* \section building_sec Building the Python Bindings
*
* The Python bindings are built using CMake from the project root:
*
* \code{.sh}
* cmake -B build .
* cmake --build build
* \endcode
*
* \section install_sec Installation
*
* Install the bindings to your system:
*
* \code{.sh}
* cmake --install build
* \endcode
*
* The compiled `_img2num` module will be available for import in Python:
*
* \code{.py}
* import _img2num
* \endcode
*
* \section usage_sec Usage Example
*
* \code{.py}
* import numpy as np
* import _img2num
*
* # Load image as uint8 numpy array
* image = np.array([...], dtype=np.uint8).reshape((height, width, 3))
*
* # Apply Gaussian blur
* blurred = _img2num.gaussian_blur_fft(image, width, height, sigma=2.0)
*
* # Invert colors
* inverted = _img2num.invert_image(image, width, height)
*
* # Threshold
* thresholded = _img2num.threshold_image(image, width, height, num_thresholds=4)
*
* # K-means clustering
* clustered_data, labels = _img2num.kmeans(image, width, height, k=8, max_iter=50)
*
* # Bilateral filtering
* filtered = _img2num.bilateral_filter(image, width, height, sigma_spatial=3.0, sigma_range=50.0)
*
* # SVG conversion
* config = _img2num.ImageToSvgConfig()
* svg_str = _img2num.image_to_svg(image, width, height, config)
* \endcode
*
* \section api_sec API Reference
*
* Browse the detailed function and class documentation:
* - \ref img2num_functions "Core Image Processing Functions"
* - \ref img2num_classes "Configuration Classes"
*/

/** \defgroup img2num_functions Image Processing Functions
* @ingroup mainpage
* @brief Image processing functions exposed via Python bindings.
* @{
*/

/** \defgroup img2num_classes Configuration Classes
* @ingroup mainpage
* @brief Configuration classes for image processing and SVG generation.
* @{
*/

Loading