Motivation
Imagine moving a black edge slowly across a white image. A center-sampled pixel stays white until the edge passes its center, then suddenly becomes black. The geometry moved continuously; the stored value jumped because the measurement asked a yes-or-no question at one point. An integer line or circle algorithm can make that discrete question precise without changing its nature. Selecting a nearby center does not measure how much of a pixel square is covered.
To obtain a different answer, we must first ask a different question. Suppose a pixel records the average of a continuous image over a rectangular footprint. A partly covered pixel then records a mixture determined by area. For a straight edge, that area can be calculated exactly; no dense cloud of test points is needed. The calculation also reveals the assumptions that make a coverage fraction sufficient to determine color.
This note develops a complete finite formula for a single straight boundary and for the strip between two parallel boundaries. It uses exact real arithmetic, flat constant colors and an explicitly chosen box filter. It does not replace the sample-ownership rules used when assembling a triangle mesh, and it does not identify an area filter with an ideal frequency cutoff. General curved boundaries, intersecting visibility layers and spatially varying shading require further integration problems.
Definitions
Definition 2.4.1
(A pixel measurement and a center sample)
Let , where , be one rectangular pixel footprint. For a bounded integrable scalar image with a value specified at every point, its normalized box measurement is
For a vector color image the integral is taken component by component. The center sample is instead . A sample is a point evaluation; the box measurement is an average over a region.
The normalization matters: a constant image with value must produce , independently of pixel size. Equivalently, this measurement uses weight inside and zero outside it. We assume this uniform footprint is the desired measurement, rather than claim it exactly describes every display or camera. Here “exact filtering” will mean exact integration for this declared filter.
Definition 2.4.2
(Coverage for a flat opaque foreground)
Let be a measurable foreground region. Its coverage in is
Here is one inside and zero outside. Suppose the visible image is constant linear-light color on and constant linear-light color on its complement. Then
Coverage is geometric area under these assumptions; it is not the opacity of a partly transparent material.
Integrating the last equation gives
This identity is a consequence of linearity, not a universal rule that any shader output may be blended by coverage. If color varies within either region, the integral needs that variation as well. If colors are stored through a nonlinear encoding, decode to linear-light values before this averaging operation and encode the result afterward. Averaging encoded component values generally computes a different quantity.
The inequality used to include the boundary of a half-plane will not affect any area below: a nonconstant affine function's level set is a line, and a line has zero two-dimensional area. The same boundary can nevertheless contain a chosen raster sample, where a tie rule is necessary. This is why sample ownership and area integration can have different boundary bookkeeping without contradiction.
An exact finite formula for one straight edge
Start with the unit square and the half-plane
Write . Define . It is a fraction because has area one. Changing translates the edge while leaving its direction fixed.
Theorem 2.4.3
(Positive-part formula for exact box coverage)
For all real and positive ,
In particular, when , and when . On the intervening interval it is a continuous piecewise-quadratic function between zero and one.
Proof
(Inclusion-exclusion on translated corner triangles)
Set and . The unit square becomes , and area is multiplied by . In the nonnegative quadrant, the region has zero area for and otherwise is a right triangle with both legs . Its area is .
To keep only its portion in , subtract the portion with and the portion with . The first is translated by , giving nonnegative coordinates with , so its area is . The second similarly has area . The portion satisfying both conditions was subtracted twice, so add it back. Translating both coordinates gives area . Boundaries have area zero, so the strict inequalities in this subtraction do not change the result. Dividing by proves the formula.
For the square's intersection has area zero. For , every point of the square satisfies the inequality. The geometric interpretation proves the bounds on intermediate values; continuity and the piecewise-quadratic form also follow directly from the finite formula. The formula does not represent an infinite limiting sampling process.
Proof X-ray
Four triangles, with their signs explained
The four terms come from removing two coordinate bounds, then restoring their overlap. A negative shifted threshold contributes zero because its translated triangle does not exist. The denominator has two jobs: the factor two is the area of a right triangle, and converts the stretched rectangle back to the unit square. Omitting the overlap term is harmless only while ; beyond that interval it produces a false loss of area. A direct implementation can return zero and one in the two exterior cases. The proof is about exact arithmetic and supplies no floating-point cancellation bound for the four-term expression.
For the diagonal , the formula becomes especially readable:
The first interior piece is the area of a growing corner triangle. After the line passes the center, it is easier to subtract the shrinking uncovered corner triangle from one. The two expressions agree at , where the diagonal divides the square into equal halves.
There is no division by a vanishing edge coefficient in the theorem: it assumes both are positive. If and , integrate a horizontal strip instead:
For and , exchange the coordinates. If both coefficients are zero, the inequality is constant: coverage is one for and zero for . This last case is not a straight boundary and must be handled before invoking a line formula.
Moving between physical pixels and the unit square
Consider a physical half-plane with . Substitute
and put
Its coverage is the unit-square fraction for . The area Jacobian is , which cancels the normalization of the physical pixel. Thus include pixel dimensions. The coefficients alone correspond directly to a unit-size pixel. If both side lengths are the same non-unit value , retaining requires dividing by as well.
Negative coefficients are reduced by reflecting the corresponding unit coordinate. If , set . Then
so replace that coefficient by and the threshold by . Do the analogous replacement for . Reflections preserve area. After both possible reflections, denote the nonnegative coefficients by and the adjusted threshold by . Apply the positive-coefficient theorem or the one-zero-coefficient formula. For a family of parallel edges, apply the same threshold translation to each edge, so their order is preserved.
Worked example 2.4.4
(A diagonal crossing between two center decisions)
Take the unit pixel , foreground , foreground red and background blue , all in linear-light coordinates. The center has sum one and is outside, so a center-only test returns blue. The actual box coverage is
If the edge moves to , the center is inside, but the coverage is still below one:
The two samples are zero and one; the two exact area measurements are and . The discrepancy is the consequence of two different measurements, even with perfect arithmetic.
Worked example 2.4.5
(A rectangular pixel and a negative coefficient)
Let and foreground . Write , . The inequality becomes . Reflect to obtain
Consequently , , , and
As a direct check, at physical height the covered horizontal interval is , of length . Its area is . Divide by the physical pixel area two to get . Reflecting a coefficient without changing the threshold would calculate a different half-plane.
Strips, stability and the role of visibility
A zero-width geometric line has area zero. Giving every selected line sample full color is therefore not area integration of that set. To model a visible line with a box filter, specify a nonzero-width region, a different measurement, or both. For positive define the parallel strip
Because its two boundary lines have area zero, its exact unit-pixel coverage is
If exactly one coefficient is zero, use its clamp formula in the same difference; the edge-motion bound below then uses the nonzero coefficient. This follows directly because clamping is nondecreasing and cannot increase a difference.
This is subtraction of two nested regions. It does not authorize subtracting coverage fractions for arbitrary overlapping shapes. The distance between these two lines in unit-square Euclidean coordinates is . Thus the threshold interval's length is generally not the perpendicular geometric width. With unequal physical pixel dimensions, measure a requested physical width before the normalization, using the physical line normal .
Worked example 2.4.6
(A thin diagonal strip that four samples all miss)
In , take . Its perpendicular width is , and its exact coverage is
The four regular subpixel centers , , and have coordinate sums . None lies in the strip, so their equal-weight estimate is zero. The pixel center misses it too. Both numerical estimates disagree with positive exact coverage; the strip's small area does not make its omission mathematically exact.
Theorem 2.4.7
(Continuity with a quantitative edge-motion bound)
For positive and all real ,
and
For a strip with threshold width , its coverage is therefore at most .
Proof
(Complement by reflection, and slicing for the Lipschitz bound)
Bounds follow from area. The reflection changes into . This reflected region complements the half-plane with threshold , except on its zero-area boundary, proving the identity.
For the motion bound, suppose first that and . At a fixed , the old covered horizontal interval has length . Raising the threshold by increases this length by a nonnegative amount at most : clamping cannot increase the difference between two ordered numbers. Integrate over to obtain the bound. If , use vertical slices instead. If , exchange the two thresholds. Finally apply this result between and , together with the area bound one.
For the unit diagonal, a threshold displacement changes coverage by at most . In contrast, a center test jumps by one at even for arbitrarily small displacements across that threshold. This explains a particular improvement from prefiltering a translating edge. It does not prove that every sampled animation becomes free of temporal aliasing.
Visibility must be resolved in the continuous image being averaged. Suppose two opaque objects each cover half of a pixel. If their covered halves are disjoint, their union covers the whole pixel; if the halves coincide, their union covers only half. The two individual fractions are identical in both scenes. Coverage fractions alone therefore cannot recover overlap, depth ordering or the visible subregions. The flat single-foreground model avoids this extra problem by specifying the complete visible image from the start.
What supersampling and an “ideal” filter mean
A supersampling rule chooses points in and weights with . It estimates the average by
For an indicator image the estimate is a weighted count. Under the current flat-color model, it gives estimated coverage . It is an approximation to the declared integral, not its definition. A native multisampling pipeline can also share shading computations among coverage samples; the existence of several coverage tests does not by itself establish several independent evaluations of every shading quantity.
Counterexample mode
No fixed finite sample set detects every thin strip
Fix any finite collection of sample points in . Their sums form a finite set of numbers. There is an open interval inside containing none of these numbers, with . The strip contains no selected sample, but it has area . Hence every weighted point estimate above is zero while the exact coverage is positive. The strip depends on the sample set; this is not a claim that one fixed strip defeats every possible sampling arrangement. It proves there is no universal exact finite point rule for all such thin features.
Increasing the number of samples can improve an approximation. Convergence statements, error rates and statistical guarantees require hypotheses about the image and sampling rule. For example, uniform independent random sample positions give an unbiased coverage estimate because the probability of landing in is its area fraction; that observation still does not make an individual finite estimate exact. The deterministic counterexample concerns a rule fixed before the geometry is selected.
The word “ideal” needs equal care. An exact box average is ideal only for the explicitly chosen uniform rectangular measurement. It is not an ideal low-pass filter with a sharp frequency cutoff. This can be seen without a general Fourier theorem. Average the one-dimensional oscillation over a centered interval of width :
where the final factor is one at by continuity. The identity follows by integrating the exponential for ; real and imaginary parts give the same statement for sine and cosine. The response has isolated zeros and nonzero side lobes, rather than vanishing at every frequency beyond a cutoff. A rectangular two-dimensional average has the product of the two coordinate responses, because the integral separates.
An ideal frequency cutoff is a different mathematical operator; in one dimension its spatial convolution kernel is proportional to a sinc function with infinite support. An exact finite-footprint coverage computation makes no such band-limit assumption. A sharp indicator edge is itself not bandlimited, and exact box averaging alone does not remove every high frequency. Calling a box filter “perfect antialiasing” would therefore extend the calculation beyond its hypotheses.
Common mistakes and a quick check
Common mistake
(Reading coverage as opacity or as a sample count)
A coverage of means a quarter of the footprint is foreground under the specified geometry and uniform filter. It does not mean the entire pixel contains a material with opacity , nor does it mean that exactly one of every four arbitrary sample positions must be covered. A finite sample estimate can change when positions change while the continuous area stays fixed.
Common mistake
(Confusing a boundary convention with moving the boundary)
A line's inclusion convention has no effect on its area, but can change a point result at equality. Conversely, moving a half-plane boundary to a different grid-aligned position changes the region on a set of positive area and can change exact coverage. These two operations should not be confused. Likewise, the area of a zero-width line is zero, whereas a finite-width stroke needs a region definition, including caps and joins if it is a finite segment. Our strip has parallel sides extending indefinitely; no endpoint cap model is being silently supplied.
Quick check
(Consider in . What is its exact coverage, and does a center test return that value?)
Use the reflection .
Solution · Answer
The exact fraction is by reflection. Its center lies on the edge, so a center test may return zero or one according to its declared tie policy. Neither binary result is the exact box average. The mismatch survives any decision about which region owns the boundary sample.
Exercises
Quick check
(Find the exact coverages in of , , and . Give one geometric check on the middle two answers.)
Locate each threshold relative to the intervals and .
Solution · Answer
The answers are respectively , , and . For the second threshold the covered corner triangle has legs and area . Reflection maps it to the uncovered corner at the third threshold, so those two fractions sum to one. The first and fourth thresholds are outside the interval of possible sums .
Quick check
(Compute the coverage of in . Find the exact result also by integrating the covered vertical-slice lengths, showing where the expression changes.)
Use , then check by integrating vertical slices.
Solution · Guided solution
The formula gives
At fixed , the covered vertical length is . It is one for , is for , and is zero afterward. Thus
Quick check
(In , find the coverage of . State the normalized inequality before and after any reflection.)
Substitute and first.
Solution · Answer
Substitute and to get . Reflect to obtain , equivalent to . The fraction is . The original boundary passes through the rectangular pixel's center ; central symmetry exchanges the two portions and supplies a geometric check.
Quick check
(A strip in is . Find its area fraction and perpendicular width. Explain why its center being inside is insufficient to establish full coverage.)
Subtract two half-plane coverages.
Solution · Answer
Coverage is . Perpendicular width is . The center has sum one, but the two uncovered corner triangles each have area . A point lying in a set does not force its whole surrounding footprint to lie in it.
Quick check
(On , set scalar image . Compute its exact box average. Compare it with the coverage fraction times the foreground value at the pixel center, and identify the failed hypothesis.)
Integrate in first.
Solution · Guided solution
Integrate first in :
The region has coverage . Assigning it the center foreground value would give , which is different. Foreground intensity is spatially varying rather than constant. Its actual average over the foreground triangle is . Coverage times that regional mean gives the correct answer, but the mean is an additional integral, not information contained in coverage alone.
Quick check
(For a one-dimensional box of width , evaluate its response factor at and . Explain why the second value prevents this box from being a sharp low-pass filter with cutoff .)
Evaluate .
Solution · Guided solution
At , the factor is . At , it is . The negative sign is a phase inversion of this oscillation, not a negative averaging weight. A frequency above the proposed cutoff survives, so one zero of the response does not establish a sharp cutoff. The box also attenuates frequencies inside the proposed passband: at the factor is , rather than one.
Related notes and limits
The rasterization and interpolation note supplies point tests, boundary ownership and sample-wise depth. The integer line and midpoint-circle notes specify discrete boundary selections. This note adds exact area measurements for straight edges and infinite parallel strips with flat visible colors. Together they explain why precise rasterization and antialiasing answer related but distinct questions.
Exact finite-segment caps and joins, curved-boundary area formulas, general polygon integration with varying attributes, visibility-aware continuous integration, reconstruction-filter design and numerical robustness remain further topics. This unit does not establish native API conformance or a GPU implementation.