Convert images into one or more flat 3D models (STL files) using a modified marching squares–style algorithm.
This tool is primarily intended for logos and simple graphics, but can also be used with more complex images by mapping additional colors.
For most images the model will be pretty complex, so it is reccomended to preprocces the model in programs like blender. I reccomend the decimate modifier to reduce face cound without removing too many details.
- Image to flat 3D model (STL) conversion
- Color-based shape extraction
- Modified marching squares algorithm
- Export single or multiple colors
- Frontend GUI (TypeScript)
- C++ backend (Docker-ready)
- Logos and icons
- Flat relief-style 3D models
- Rapid STL generation from images
- 3D printable models
- Geometry extraction experiments
git clone https://github.com/TheStrgamer/Marching-Image.git
cd Marching-ImageFor running both frontend and backend it is reccomended to use docker Make sure docker is running and use this command
docker compose up --buildThis application can be run with frontend only, to run it, use the following commands
cd frontend/colormap
npm install
npm run devTo run the backend on linux, you need the following requirements
- CMake
- g++
- OpenCV (with PNG support)
- Boost
- Asio
- nlohmann-json
can be installed with these commands if you use the apt package manager
sudo apt update
sudo apt install -y \
cmake \
g++ \
make \
libopencv-dev \
libboost-all-dev \
libasio-dev \
nlohmann-json3-dev \
gitTo run the backend, use
cd backend
git clone https://github.com/CrowCpp/crow.git external/crow
mkdir -p build
cd build
cmake ..
make
./ColormapThe image is processed one color at a time. A binary matrix is created for each color:
1 → pixel matches the selected color
0 → pixel does not match
A marching squares–inspired lookup table determines vertex placement. Faces are generated to create flat 3D geometry
The result is exported as an STL file
For more information on standard marching squares, see: https://en.wikipedia.org/wiki/Marching_squares
The logo mapped in the application
The resulting model in blender
The shape mapped in the application
The resulting model in blender
For more complex images, more colors might be needed to make it look good Here is an example with an image of me.
The resulting model in blender, with colors





