dylanebert's picture
initial commit
346b70f

A newer version of the Gradio SDK is available: 6.2.0

Upgrade

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 function
  • get_face_colors(mesh, simplify_details, detail_sensitivity) - Read colors from mesh
  • sample_colors(colors, sample_rate, areas) - Sample with weighting

Dependencies

  • Internal: preprocessing.simplify_texture
  • External: NumPy, trimesh, OpenCV