---
title: "Redness"
description: "Erythema scoring (0..1) per face region, with mask shapes and a polygon-area visualization channel for AR rendering."
editUrl: true
head: []
template: "doc"
sidebar: {"order":2,"hidden":false,"attrs":{}}
pagefind: true
draft: false
kind: "concept"
tags: ["redness", "redness_visualization", "redness_absolute", "skin"]
---
import ConceptOverlay from "../../../components/ConceptOverlay.astro";
import { Aside } from "@astrojs/starlight/components";

## Overview

Redness metric responds to variations of the amount of red color (caused by e.g. local inflammation) in the skin disregarding the base skin tone.

```yaml
component: redness
request:
  query: "components=redness"
response_path: "results[].description == \"redness\""
value_range: [0, 1]              # normalized severity
also_request:
  - redness_visualization        # polygon-area features, 3 intensity levels by default
  - redness_absolute             # tone-adjusted variant for cross-user comparison
warnings: []                   # redness emits no metric-specific codes
```

## What the API returns

Request the component:

```http
?components=redness
```

The corresponding entry in `results[]`:

```jsonc
{
  "description": "redness",
  "value": 0.18,                  // 0..1, normalized severity
  "message": "Ok",
  "local_warnings": [],
  "measurement_locations": [
    { "description": "left cheek",  "value": 0.21, "AOI_x_o": 412, "AOI_y_o": 580, "AOI_radius_o": 90, "ut_zone": "u-zone" },
    { "description": "right cheek", "value": 0.19, "..." },
    { "description": "forehead",    "value": 0.11, "..." }
    // …11 regions in total (cheeks, forehead, nose, chin, around-mouth, around/under-eye).
    // A region returns value -1 when its mask is unavailable.
    // The overall score is the top-level `value` — there is no "Global" region entry.
  ],
  "sum_measures": []
}
```

If you also request `redness_visualization`, you get a `visualization_data[]` array of **polygon-area features** with 3 intensity levels by default (per-feature `intensity` is a category integer `1..3`, not a continuous score). Higher-intensity polygons sit *inside* lower-intensity ones — render with low opacity and the layering produces a heatmap-like gradient. See [Rendering recipes → Polygon areas](/guides/rendering-recipes/#recipe-3--polygon-areas).

For a tone-adjusted variant intended for comparison across users, request `redness_absolute` instead.

## Reference imagery

<ConceptOverlay
  slug="redness"
  baseAlt="Reference selfie used as analysis input"
  overlayAlt="Same image with redness heatmap overlay applied"
  caption="Reference image (left) vs. redness heatmap (right). Warmer regions correspond to higher local redness values."
/>

## Rendering notes

For a numeric UI:

```js
const redness = response.results.find((r) => r.description === "redness");
const score = Math.round(redness.value * 100);   // 0..100
```

For a regional breakdown:

```js
const regions = redness.measurement_locations
  .filter((m) => m.value >= 0)              // skip unavailable regions (value -1)
  .sort((a, b) => b.value - a.value);
```

For a heatmap-style overlay:

1. Request `redness_visualization` alongside `redness`.
2. Sort `visualization_data[]` ascending by `intensity` (categorical 1..3).
3. For each feature, fill the polygon defined by its `x[]` / `y[]` arrays with a warm color, opacity ≈ 0.45.
4. Higher-intensity polygons naturally render on top, producing a layered gradient.
5. The polygon colours here are ones you choose, so colour balance doesn't apply to them. Only if you also overlay a CV-measured colour (e.g. a skin/foundation swatch) do you re-bias it with [`inverse_color_balance_rb`](/guides/interpreting-results/#inverse_color_balance_rb) so it matches the original photo.

Paste-ready code: [Rendering recipes → Polygon areas](/guides/rendering-recipes/#recipe-3--polygon-areas).

## Edge cases

- **Heavy makeup** can mask redness, so the score may understate true erythema when coverage products are worn. The API has no makeup-coverage signal to gate on, so surface a "based on visible skin" disclaimer rather than trying to auto-hide.

## `local_warnings[]` for this metric

The `redness` metric emits no metric-specific `local_warnings[]` codes; it inherits the global image-quality codes. When a region's mask can't be generated, that region simply returns `value: -1` (no status code). See [Error handling](/guides/error-handling/).
