Project on hold / archived. A lightweight Python CLI pipeline designed to convert standard raster images into multi-color 3D-printable models (
.3mfand meshes) optimized for FDM multi-material and layered workflows. Developed for personal use.
- Automated End-to-End Generation: Automatically processes images and structures output parameters directly through configuration without requiring complex upfront manual tweaking.
- Multi-Format Output: Generates both structured 3D models (
.3mf) ready for layer-based printing workflows and geometric components. - Color Quantization: Reduces complex image color palettes down to a clean set of target colors ideal for sharp 3D prints.
- FDM Print Customization: Fine-tune physical widths, layer heights, base thicknesses, and color layers directly via configuration.
- Filament Transparency & Brand Analysis (Not Implemented): The pipeline does not currently analyze or automatically map real-world manufacturer filament transmission distances (TD) or color transparency into the print sequence. True automated physical blending requires interactive calibration and visual tuning, which remains outside the scope of this prototype.
- Interactive UI: Interactive color-mapping controls and visual slicing sliders are omitted in favor of configuration-driven automation.
While Layer Forge processes a wide variety of raster images, graphic-heavy, stylized, or high-contrast imagery yields the most striking multi-material results.
If you need test candidates, you can explore visual collections or automate downloading batches of reference images using Pinterest-Collector.
The project maintains a modular workspace structure:
Layer Forge/
│
├── defaults/ # Default templates (config.json, filaments.csv, templates)
├── docs/ # Documentation generator metadata and scripts
├── modules/ # Core processing modules (color mapping, config, 3D generator)
├── workspace/ # Active workspace (input images, generated layers, .3mf output)
├── main.py # Main entry point script
└── README.md # Project documentation
{
"mode": "full",
"input": "source.jpg",
"output_dir": "output_layers",
"output_format": "stl",
"colors_count": 4,
"dither": false,
"brightness": 0,
"contrast": 0,
"print_settings": {
"width": 50,
"layer_height": 0.08,
"base_layers": 4,
"color_layers": 3,
"print_order": "auto_by_area",
"filament_type": "PLA",
"filament_colors": ["#000000", "#FFFFFF", "#FF0000", "#00FF00"]
}
}| Parameter | Type | Default | Description |
|---|---|---|---|
input_image |
String | "source.jpg" |
Path to the input image file (JPEG, PNG). |
output_dir |
String | "output_layers" |
Target directory where generated masks and previews will be saved. |
colors_count |
Integer | 4 |
Target number of colors for palette quantization (number of layers). |
dither |
Boolean | false |
Enables (true) or disables (false) Floyd-Steinberg dithering. Set to false for clean, solid graphic boundaries. |
brightness |
Integer | 0 |
Brightness adjustment percentage (-100 to 100) applied before processing. |
contrast |
Integer | 0 |
Contrast adjustment percentage (-100 to 100) applied before processing. |
| Print Settings (`print_settings`) | |||
layer_height |
Float | 0.2 |
Base physical height of a single print layer in millimeters. |
base_layers_multiplier |
Integer | 8 |
Multiplier for the solid bottom base layers (e.g., 8 x 0.2 mm = 1.6 mm total base thickness). |
use_custom_heights |
Boolean | false |
Enables (true) custom extrusion heights per color layer instead of a uniform thickness. |
color_layer_heights |
Array | [0.6, 0.4, 0.4, 0.4] |
Individual extrusion heights in millimeters for each corresponding color layer when custom heights are active. |
ams_mode |
Boolean | true |
Enables (true) multi-material mode (AMS/MMU) or disables (false) for single-extruder manual color swaps. |
print_order |
String | "auto_by_area" |
Layer printing sequence strategy ("auto_by_area" for largest background masks first, or "sequential" for strict file ordering). |
- Requirements Make sure you have Python installed along with the Pillow library:
pip install Pillow numpy trimesh- Running Run the processing pipeline via:
python main.py