a11y-toolkit: Text-over-image contrast
a11y_contrast_imageSample the real background behind text to compute contrast ratios, AA pass percentage, and detect hostile zones in images with photos or gradients.
Instructions
TEXT OVER IMAGE contrast: pixel-level sampling of the real background behind the text box → worst/median/p95 ratio, % of area passing AA, and automatic hostile-zone detection on a 3×3 grid (zona_peor). What pair-only checkers cannot do. region="x,y,w,h" recommended. — Use instead of a11y_contrast_pair whenever the background is a photo/gradient.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lang | No | Output language (default en) | |
| path | Yes | Local path to the screenshot/image the text sits on (PNG/JPG/PPM) | |
| region | No | Text bounding box as "x,y,width,height" in pixels (strongly recommended: defines what to sample) | |
| sample | No | Pixel step: 4 samples every 4px (auto-raised for huge regions) | |
| text_color | Yes | The text color as rendered over the image (must be opaque) |