---
title: "Redness"
description: "Erythema scoring (0..1) per face region, with mask shapes and a polygon-area visualization channel."
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 VisualizationExample from "../../../components/VisualizationExample.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             # alternative overall score (top-level value only)
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 that isn't analyzed returns value -1.
    // 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).

`redness_absolute` is a variant of this metric on a different output scale, provided for integrations set up with it. Use `redness` unless Revieve has configured your integration otherwise; see [Metric variants](/concepts/metric-relationships/#metric-variants). It returns only the top-level `value`: no regions, mask shapes, or visualization data.

## Visualization example

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

```js title="metrics/redness.js"
// Requires render.js and polygon-areas.js from /demos/recipes/ (or revieve-render.js).
// ctx: 2D context of a canvas sized to the analysed image. response: parsed analyzeImage JSON.
// Redness: polygon areas at levels 1..3, drawn low to high so higher levels sit on top; the level shows as a denser fill of the same colour.
renderMetric(ctx, response, "redness", {
  draw: drawPolygonArea,
  colorForLevel: () => "#3377FF",                      // one colour, outside the skin-tone gamut
  opacityForLevel: (level) => [0.12, 0.22, 0.32][level - 1] ?? 0.32,   // the level is the fill density
});
```

## 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 colour outside the skin-tone gamut (the recipes use blue), at a low opacity that rises with the level (0.12, 0.22, 0.32), with a 2 px outline in the same colour. Warm colours fuse into light skin and read as the condition itself.
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. A region that isn't analyzed returns `value: -1` (no status code). See [Error handling](/guides/error-handling/).
