Melasma
Overview
Section titled “Overview”Melasma is a specific type of hyperpigmentation that presents as larger, irregular patches — typically on cheeks, forehead, and upper lip.
component: melasmarequest: query: "components=melasma,melasma_visualization"response_path: "results[].description == \"melasma\""value_range: [0, 1]also_request: - melasma_visualization # polygon-area features, 3 intensity levels by defaultwarnings: [] # melasma emits no metric-specific codesVisualization example
Section titled “Visualization example”Code: metrics/melasma.js. Change the code to change the picture.
renderMetric and drawPolygonArea come from the rendering recipes guide (Recipe 3 — polygon areas); get them as files. Edits stay in this browser tab.
This picture shows the metric's visualization_data from a recorded response, drawn on the photo that was analyzed. Click a thumbnail to select a different model. Hold the photo to hide the overlay.
Rendering notes
Section titled “Rendering notes”const m = response.results.find((r) => r.description === "melasma");When both hyperpigmentation and melasma register, surface them as separate findings — they trigger different product categories (sunscreen + tranexamic acid for melasma vs. vitamin C / retinoid for general pigment).
Melasma also returns a per-region breakdown in measurement_locations[] — one entry per face region, each with its own value (0..1), mask_shapes, and (when melasma_visualization is requested) polygon-area visualization_data. A region that isn’t analyzed returns value: -1 — treat that as “region unavailable,” not a real low score.
local_warnings[]
Section titled “local_warnings[]”The melasma metric emits no metric-specific local_warnings[] codes. It inherits global image-quality codes; a skin-mask sampling failure is reported as 401 on the hyperpigmentation finding, not on melasma.
Related
Section titled “Related”- Visualization data — Cat D (AOI + mask + advanced); 3 intensity levels. Per-feature
intensityis a level index1..3, not a continuous score. - Rendering recipes → Polygon areas — paste-ready renderer.