# Mesh Palettizer Core Core library for 3D model texture palette optimization ## Purpose - Extract colors from mesh textures and materials - Generate optimized palettes via perceptual clustering - Build color palettes and remap mesh UVs - Support multi-mesh scenes with shared textures ## Layout ``` src/ ├── context.md # This file ├── __init__.py # Main API: convert_meshes() ├── preprocessing/ # Texture detail removal ├── extraction/ # Color extraction from meshes ├── palette/ # Palette generation and mapping ├── atlas/ # Palette texture creation └── mesh/ # UV remapping ``` ## Scope - In-scope: Mesh processing, color quantization, UV mapping - Out-of-scope: File I/O, API calls, web interface ## Entrypoints - `convert_meshes(mesh_list, atlas_size, face_sampling_ratio, simplify_details, detail_sensitivity, scene_metadata)` - Main API - Returns: `ConversionResult` with processed meshes, palette, and scene metadata ## Dependencies - Internal: All submodules - External: numpy, trimesh, PIL, scikit-learn, scipy