MMIDS-CMP-2025: Computational Image Analysis Standard

Multimodal Institute Documentation Standards

Version: 1.0 Effective Date: November 2025 Author: Arnaud Quercy Status: Active

---

1. Scope and Purpose

This standard defines the computational methods employed by the Multimodal Institute for objective image characterization. MMIDS-CMP-2025 establishes reproducible, deterministic analysis protocols for extracting quantitative visual metrics from artwork documentation images.

### 1.1 Applicability

This standard applies to all computational image analyses performed on artwork documentation within the Multimodal Institute's publication system. Results generated under this standard are suitable for:

- Academic citation and scholarly reference - Comparative analysis across artwork corpora - Machine-readable metadata generation - Objective visual characterization

### 1.2 Design Principles

- Determinism: Identical inputs produce identical outputs - Reproducibility: Methods are fully specified and replicable - Objectivity: No subjective interpretation in measurement - Transparency: All algorithms and parameters documented

---

2. Analysis Architecture

MMIDS-CMP-2025 comprises four independent analysis modules executed sequentially on each source image:

Module Function Primary Output
Color Extraction Dominant color identification Color palette with percentages
Texture Analysis Surface pattern characterization Roughness and pattern metrics
Brightness & Contrast Luminance distribution analysis Dynamic range and contrast values
Spatial Distribution Color relationship mapping Clustering and harmony metrics

### 2.1 Input Requirements

- Format: RGB image array (8-bit per channel) - Minimum Resolution: 500 × 500 pixels - Maximum Resolution: Auto-downsampled to 1000 × 1000 for performance - Color Space: sRGB (converted internally as needed)

---

3. Module 1: Color Extraction

### 3.1 Method Overview

Color extraction employs K-means clustering to identify statistically dominant colors within the image. The algorithm partitions pixel color values into K clusters, with cluster centroids representing the extracted colors.

### 3.2 Algorithm Specification

Primary Method: K-means clustering (scikit-learn implementation)

``` Parameters: - n_clusters: 10 (default, configurable) - random_state: 42 (deterministic seeding) - n_init: 10 (initialization attempts) - max_iter: 300 (convergence iterations) ```

Alternative Methods: - Histogram analysis (16³ bin quantization) - OpenCV K-means quantization (cv2.KMEANS_RANDOM_CENTERS)

### 3.3 Color Space Transformations

Each extracted color undergoes conversion to multiple color spaces:

HSL (Hue-Saturation-Lightness): - Hue: 0–360° angular position on color wheel - Saturation: 0.0–1.0 color intensity - Lightness: 0.0–1.0 brightness value

LAB (CIELAB): - L: 0–255 lightness channel - a: 0–255 green-red axis (centered at 128) - b: 0–255 blue-yellow axis (centered at 128) - Chroma: √((a-128)² + (b-128)²) - Hue: arctan2(b-128, a-128) in degrees

### 3.4 Color Family Classification

Colors are assigned to a 12-band color wheel based on LAB hue angle:

LAB Hue Range Color Family
345°–15° Red
15°–45° Red-Orange
45°–75° Orange
75°–95° Yellow-Orange
95°–110° Yellow
110°–165° Yellow-Green
165°–195° Green
195°–225° Blue-Green
225°–255° Blue
255°–285° Blue-Violet
285°–315° Violet
315°–345° Red-Violet

Achromatic Detection: Colors with chroma < 5 and |a-128| < 10 and |b-128| < 10 are classified as: - Black (L < 20) - White (L > 200) - Gray (20 ≤ L ≤ 200)

### 3.5 Accent Color Detection

Spatially coherent accent colors are detected through region-based analysis:

1. Create mask of pixels dissimilar to dominant colors (threshold: RGB distance > 40) 2. Label connected regions using scipy.ndimage.label 3. Filter regions by minimum size (20 pixels) 4. Calculate region importance score: - Size score: min(region_size / 1000, 1.0) × 0.3 - Saturation score: HSL saturation × 0.3 - Contrast score: border color distance × 0.4 5. Accept regions with importance > 0.08

### 3.6 Output Format

```json { "method": "k-means", "colors": [ { "rank": 1, "hex": "C4D0B0", "percentage": 23.5, "family": "yellow-green", "name": "pale olive" } ], "families": { "yellow-green": 45.2, "green": 30.1 }, "accent_colors": [ { "hex": "8B4A6B", "family": "red-violet", "name": "dusty mauve [Accent]", "chroma": 32.5 } ] } ```

---

4. Module 2: Texture Analysis

### 4.1 Method Overview

Texture analysis quantifies surface characteristics through multiple complementary techniques: roughness measurement, gradient analysis, pattern detection, and spatial variation mapping.

### 4.2 Roughness Metrics

Global Roughness: - Standard deviation of grayscale pixel intensities - Normalized to 0.0–1.0 range (÷ 255)

Local Roughness: - 5×5 kernel local standard deviation - Mean and variance of local roughness values

Edge Density: - Canny edge detection (thresholds: 50, 150) - Ratio of edge pixels to total pixels

### 4.3 Gradient Analysis

Sobel Gradient Computation: ``` grad_x = cv2.Sobel(gray, CV_64F, 1, 0, ksize=3) grad_y = cv2.Sobel(gray, CV_64F, 0, 1, ksize=3) magnitude = √(grad_x² + grad_y²) direction = arctan2(grad_y, grad_x) ```

Derived Metrics: - Mean gradient magnitude (normalized) - Gradient variance - Gradient smoothness: 1 - (σ_gradient / μ_gradient) - Directional coherence: √(mean(cos(θ))² + mean(sin(θ))²)

### 4.4 Pattern Analysis

Local Binary Pattern (LBP): - 8-point neighborhood comparison - Binary encoding of intensity relationships - Pattern complexity = variance(LBP) / 255²

Autocorrelation: - FFT-based 2D autocorrelation - Detection of repetitive patterns via off-center peaks

Frequency Domain: - FFT magnitude spectrum analysis - Detail frequency ratio: high_freq_energy / total_energy

### 4.5 Spatial Variation

Image divided into 4×4 grid (16 regions): - Inter-region variation: σ(region_means) / 255 - Texture consistency: 1 - (σ(region_stds) / μ(region_stds))

### 4.6 Output Format

```json { "global_roughness": 0.135, "mean_local_roughness": 0.089, "edge_density": 0.042, "mean_gradient_magnitude": 0.067, "directional_coherence": 0.234, "pattern_complexity": 0.156, "spatial_variation": 0.078, "texture_consistency": 0.823 } ```

---

5. Module 3: Brightness & Contrast Analysis

### 5.1 Method Overview

Brightness and contrast analysis quantifies luminance distribution, dynamic range, and local contrast patterns using established photometric measurements.

### 5.2 Luminance Metrics

Grayscale Conversion: - cv2.COLOR_RGB2GRAY (luminance-weighted)

Basic Statistics: - Mean brightness: μ(gray) / 255 - Brightness variance: σ(gray) / 255 - Brightness uniformity: 1 - (σ / μ) - Brightness skewness: E[(x - μ)³] / σ³

Entropy: - Histogram-based information content - H = -Σ(p_i × log₂(p_i))

### 5.3 Contrast Measurements

RMS Contrast: - Root mean square of intensity deviations - C_rms = σ(gray) / 255

Michelson Contrast: - C_m = (I_max - I_min) / (I_max + I_min) - Suitable for periodic patterns

Weber Contrast: - C_w = |I_object - I_background| / I_background - Object: 10th percentile, Background: 90th percentile

Local Contrast: - 7×7 kernel local mean subtraction - Mean and uniformity of local contrast

### 5.4 Dynamic Range Analysis

Basic Range: - (max - min) / 255

Effective Range: - (P95 - P05) / 255 (excludes outliers)

Tonal Distribution: - Shadows: histogram[0:85] percentage - Midtones: histogram[85:170] percentage - Highlights: histogram[170:255] percentage

Clipping Assessment: - Shadow clipping: histogram[0] percentage - Highlight clipping: histogram[255] percentage

### 5.5 Multi-Scale Local Contrast

Analysis at three scales (3×3, 7×7, 15×15 kernels): - Fine contrast (detail) - Medium contrast - Coarse contrast (large-scale variation) - Multi-scale ratio: fine / coarse

### 5.6 Output Format

```json { "mean_brightness": 0.672, "brightness_variance": 0.145, "rms_contrast": 0.234, "michelson_contrast": 0.756, "dynamic_range": 0.892, "shadow_percentage": 12.3, "midtone_percentage": 65.4, "highlight_percentage": 22.3, "fine_contrast": 0.089, "coarse_contrast": 0.156 } ```

---

6. Module 4: Spatial Distribution Analysis

### 6.1 Method Overview

Spatial distribution analysis examines how colors are arranged across the image, measuring clustering, transitions, saturation patterns, and color harmony relationships.

### 6.2 Spatial Clustering

Method: 1. Sample pixels at regular intervals (√1000 step size) 2. K-means clustering on sampled RGB values (K=8) 3. For each cluster, calculate average distance between member pixels 4. Normalize by image diagonal

Metrics: - Spatial coherence: 1 - (normalized_avg_distance) - Color clustering coefficient: 1 - (within_cluster_var / total_var)

### 6.3 Color Transition Analysis

LAB-based Gradient: - Sobel gradients computed per LAB channel - Combined gradient: √(Σ channel_gradients²)

Transition Metrics: - Smoothness: 1 - min(1, mean_gradient / 100) - Uniformity: 1 - min(1, gradient_variance / 10000) - Sharp transition ratio: pixels > P90(gradient) / total - Directionality: coherence of gradient angles

### 6.4 Saturation Distribution

HSV Saturation Analysis: - Mean saturation (0.0–1.0) - Saturation variance - Distribution categories: - Low: S < 0.3 - Medium: 0.3 ≤ S < 0.7 - High: S ≥ 0.7 - Saturation clustering: spatial coherence of saturation levels

### 6.5 Color Harmony Analysis

Hue Concentration: - Circular variance of saturated pixel hues - Concentration = 1 - circular_variance

Complementary Balance: - Detection of opposite hue pairs (180° apart) - Balance = complementary_pairs / total_saturated

Analogous Dominance: - 12 groups at 30° intervals, 45° tolerance - Dominance = max_group / total_saturated

Temperature Bias: - Warm hues: 0°–60° and 300°–360° - Cool hues: 120°–240° - Bias = warm_ratio - cool_ratio (-1 to +1)

### 6.6 Output Format

```json { "spatial_coherence": 0.456, "color_clustering": 0.678, "color_transition_smoothness": 0.789, "sharp_transition_ratio": 0.034, "mean_saturation": 0.263, "saturation_variance": 0.089, "hue_concentration": 0.567, "complementary_balance": 0.123, "analogous_dominance": 0.678, "temperature_bias": -0.234 } ```

---

7. Quality Assurance

### 7.1 Determinism Verification

All random operations use fixed seeds: - K-means: random_state=42 - All results reproducible given identical input

### 7.2 Performance Optimization

- Images > 1,000,000 pixels automatically downsampled - Sampling strategies for computationally intensive operations - Target processing time: < 30 seconds per image

### 7.3 Error Handling

- Graceful fallback values for edge cases - Empty/corrupt image detection - Numeric overflow prevention (uint8 → int conversion)

### 7.4 Validation

Each metric includes defined ranges: - Normalized values: 0.0–1.0 - Percentages: 0–100 - Angles: 0–360° - Temperature bias: -1.0 to +1.0

---

8. Implementation Reference

### 8.1 Software Dependencies

Library Version Purpose
NumPy ≥1.20 Array operations
OpenCV ≥4.5 Image processing, color conversion
scikit-learn ≥1.0 K-means clustering
SciPy ≥1.7 ndimage, spatial distance
webcolors ≥1.11 CSS3 color name matching

### 8.2 Color Space Standards

- RGB: sRGB IEC 61966-2-1 - LAB: CIELAB D65 illuminant - HSL: Standard cylindrical representation

---

9. Citation

When referencing analyses performed under this standard:

Quercy, A. (2025). Computational Image Analysis Standard - MMIDS-CMP-2025. Multimodal Institute. https://multimodal.institute/en/publications/2025/11/mmids2025cmp-computational-image-analysis-standard.html

---

10. Version History

Version Date Changes
1.0 November 2025 Initial release

---

Document Identifier: MMIDS-CMP-2025 Publisher: Multimodal Institute License: CC BY-NC 4.0