Spaces:
Sleeping
Sleeping
A newer version of the Gradio SDK is available:
6.2.0
Color Extraction Module
Extract colors from 3D mesh materials and textures
Purpose
- Sample colors from mesh faces
- Read from textures via UV coordinates
- Apply area-weighted sampling
Layout
extraction/
βββ context.md # This file
βββ __init__.py # API: extract_colors()
βββ sampler.py # Random sampling strategies
βββ reader.py # Read colors from materials
Scope
- In-scope: Color extraction, texture sampling, UV mapping
- Out-of-scope: Color quantization, atlas generation
Entrypoints
extract_colors(mesh, sample_rate, simplify_details, detail_sensitivity)- Main extraction functionget_face_colors(mesh, simplify_details, detail_sensitivity)- Read colors from meshsample_colors(colors, sample_rate, areas)- Sample with weighting
Dependencies
- Internal: preprocessing.simplify_texture
- External: NumPy, trimesh, OpenCV