# Text layers: separate checks miss collisions

Two layers each fit inside the frame. Their combined image reveals a collision. Our trial measures pixels without claiming viewer readability.

L00P.AI · 1.0 · 2026-11-21

https://www.l00p.ai/en/resources/series/warstwy-tekstu-osobny-odbior-nie-wykrywa-kolizji/

## 01 / Accept the combined image

The caption fits inside the frame. So does the speaker label. Both pass separate checks, yet their combination occupies the same pixels. For someone commissioning a production, this adds an acceptance condition: check all simultaneously visible layers together, in the variants intended for release.

Our [article on render acceptance](/en/resources/series/dobry-render-to-jeszcze-nie-odebrany-material/) proposed checking captions, speaker labels and context cards together. We have now tested a narrow part of that method: intersection of the actual rendered characters of two original, fictional texts. This trial uses static images, without a recording or a reader study.

## 02 / A rectangle and a rendered character

[Pillow ImageDraw](https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html#PIL.ImageDraw.ImageDraw.textbbox) provides a text bounding box relative to a specified anchor. The documentation notes that some fonts can add margins. A rectangle describes extent; it does not identify which pixels a character occupies.

Each layer in our trial has a separate [grayscale mask](https://pillow.readthedocs.io/en/stable/reference/Image.html): zero means no coverage, while a value greater than zero means coverage, including antialiased edges. We count positions where both masks are nonzero. This is an explicitly chosen geometric metric. It does not measure word recognition or viewer attention.

For example, in the large variant, TEST CAPTION had an API box of (64, 600, 352, 630) and nonzero coverage bounds of (64, 600, 350, 630). The right boundaries differ by two pixels. These coordinates describe a range including the left and top boundaries and excluding the right and bottom boundaries. We do not replace the mask with the rectangle's area.

## 03 / One trial, four variants

On 21 November 2026 we rendered TEST CAPTION and the fictional label MIRA TEST. The large image is 1280 × 720 pixels with a font size of 40 px. The small image is 390 × 219 pixels with an 18 px font. These are two separate target rasters; the small image is neither a resized copy of the large one nor a physical phone test.

In the large variant the caption starts at (64, 600). The colliding label has the same origin; the separated label starts at (64, 520). In the small variant the caption starts at (16, 170), as does the colliding label; the separated label starts at (16, 125). The origin uses an explicit lt anchor. We used L masks, background 0, fill 255 and stroke width 0.

In each of the four compositions, both individual layers were nonempty and fit inside the image. Joint checking found 1018 shared pixels for the same-origin variant in the large raster and 345 in the small raster. Vertical separation produced zero in each.

![Shared pixels: 1280 × 720, collision 1018, separated 0; 390 × 219, collision 345, separated 0. This is not a readability metric.](https://www.l00p.ai/wydawnictwo/warstwy-tekstu-osobny-odbior-nie-wykrywa-kolizji/collision-en-v1.svg)

```text
Own ASCII fixtures; nonzero coverage > 0
target       font px   same origin   separated
1280 x 720      40          1018           0
 390 x 219      18           345           0
unit: shared pixel positions, not rectangle area
separate layers inside frame: yes in all 4 cases
```

These counts come from different rasters and character sizes. They do not rank large-screen and small-screen readability. Zero means only that there is no intersection under the declared metric.

## 04 / A check that lets the defect through

Before the trial we recorded the rule: the separated variant must have exactly zero shared pixels; the same-origin variant must have at least one. We did not predict exact positive counts. We separately specified a defective acceptance procedure checking only whether each layer was nonempty and fit inside the frame.

The defective procedure accepted the colliding compositions too. The joint check rejected them. This negative control demonstrates a specific gap in the acceptance procedure. All 24 recorded checks of one trial passed; these were not 24 independent experiments.

A later inspection of saved artifacts checked 48 hashes, protocol and execution order, raw masks, composites and PNG agreement with raw data. We did not rerun the original render. Local bounds of individual characters were saved separately; we do not present them as character positions after contextual shaping of a complete sentence.

## 05 / What to put in the brief

Specify the texts, font face and version, sizes, anchor, positions, stroke and target aspect ratios. Preserve each layer and their composition. Record the collision metric and rejection condition before assessing the result. Check a new variant whenever the language, content or line wrapping changes.

For a real film, add a timing check: which captions, labels and cards are visible at the same moment. Then view the finished release against its image background and check contrast, size, exposure time and meaning. Absence of geometric intersection does not accept those properties. This trial establishes no universal margin or reading time.

## 06 / Provenance and limits

We used Pillow 12.3.0, FreeType 2.14.3 and unmodified DejaVu Sans Mono Book 2.35, explicitly selecting the BASIC layout engine and using only ASCII texts. The online Pillow 13.0.0 documentation we read describes a newer version; we also preserved API documentation from the installed tool. [ImageFont](https://pillow.readthedocs.io/en/stable/reference/ImageFont.html) describes layout engine selection. We do not transfer the ASCII results to Polish characters, connected scripts, ligatures or another engine without a separate trial.

The font came from an existing installation; its full license was preserved and the [official DejaVu terms](https://dejavu-fonts.github.io/License.html) were checked. The test texts and geometry are original. The illustration represents saved results rather than a new measurement; it includes no downloadable font file. No photograph, third-party voice or music was used.

Codex prepared PL/EN, calculations, a deterministic SVG and a text equivalent. Editorial work and author checks are performed by the same AI agent. There was no independent second-model review, viewer study or WCAG certification. Changes to the text, font, layout engine, size or composition method trigger renewed checking; a discovered discrepancy triggers a correction. To develop acceptance for your own material, let us start with one frame containing every simultaneous layer.
