Material Analyzer Design Specification Version: 1.0 Status: Draft 1. Objective Purpose The Material Analyzer is an offline preprocessing pipeline responsible for converting every flooring SKU into a standardized Material Asset. The generated Material Asset serves as the Ground Truth for all downstream AI image generation tasks. Its objectives are: Eliminate repeated analysis during generation Standardize all flooring materials into a unified representation Improve material consistency across AI-generated images Provide reusable visual features for similarity search and quality assurance 2. Scope Supported categories: Hardwood Engineered Wood Laminate SPC LVP WPC Ceramic Tile Porcelain Tile Stone Marble Vinyl Every SKU is processed only once. 3. Pipeline SKU ↓ Load Texture Image ↓ Universal Feature Extraction ↓ Texture Feature Extraction ↓ Semantic Analysis ↓ Material Adapter ↓ Visual Embedding ↓ Asset Generation ↓ Material Asset 4. Input Example { "sku":"67907_847", "category":"SPC-LVP", "material":"Luxury Vinyl", "main_image_url":"texture.jpg", "room_image_url":"room.jpg" } 5. Output MaterialAssets/ 67907_847/ preview.jpg material.json histogram.json embedding.bin thumbnail.jpg tileable.png (future) 6. Universal Visual Features These features are extracted for every flooring material. Examples: Dominant RGB Secondary RGB LAB Color HSV Brightness Contrast Saturation Color Histogram Recommended implementation: OpenCV KMeans LAB HSV 7. Texture Features Extract low-level texture statistics. Examples: Texture Entropy Texture Frequency Edge Density Orientation Variance Recommended algorithms: GLCM LBP FFT Gabor Filter Structure Tensor 8. Semantic Features Generated by a Vision LLM. Examples: { "description":"...", "surface_finish":"Matte", "visual_style":"Natural", "grain":"Straight Oak", "variation":"Medium" } Recommended models: Gemini GPT-4o Claude 9. Material Adapter Extract category-specific features. Wood: Species Grain Direction Knot Density Cathedral Density Tile: Stone Type Vein Density Vein Orientation Grout Color SPC / LVP: Printed Pattern Emboss Depth Surface Finish 10. Visual Embeddings Generate two independent embeddings. DINOv2 Purpose: Texture similarity Material similarity Drift detection CLIP Purpose: Semantic similarity Product recommendation 11. Material Asset Schema { "sku":"", "category":"", "material":"", "visual":{ }, "texture":{ }, "semantic":{ }, "material_specific":{ }, "embeddings":{ } } 12. Future Modules Planned but not implemented. Canonical Texture Generator Tile Detection Image Quilting Seamless Texture Generation Pattern Detector 13. Future Material QA The Material Analyzer will later be reused by the Material QA module. Workflow: Generated Image ↓ Floor Segmentation ↓ Crop Floor ↓ Analyzer ↓ Compare with Ground Truth ↓ Similarity Score 14. Development Priority Phase 1 Universal Features Texture Features Semantic Features Embeddings Material JSON Phase 2 Tileable Texture Pattern Detection Phase 3 Material QA