Parity notes
Measured detail behind Limitations: the native mechanisms each area follows, the captures that pin them, and the residuals still measured. Open work is in Outstanding work; the round-by-round record is the Parity log.
Output is compared with images rendered by Windows. This page describes the current rendering behaviour and known differences from native Windows playback. The exact per-fixture bounds and tolerance levels are defined in src/gdi-parity.fixture.test.ts.
Parity is measured by comparing rendered output pixel-for-pixel against images captured from Windows GDI and GDI+. Each case in src/gdi-parity.fixture.test.ts carries a single mismatch tolerance bound, many of them nonzero to allow for fixed-point rounding and platform differences. The report script bun scripts/gdi-fixtures/report.ts reports zero-tolerance differences separately. See the current parity priorities for the zero-tolerance review, text coverage gaps and reference-environment issues.
Single-line EMF+ text alignment now follows native horizontal/vertical layout for supplied fonts with unrotated AntiAlias rendering under positive uniform scales and whole-device-pixel em sizes, including trailing-space measurement. Default italic black-box fitting, grid-fitted, rotated or nonuniformly scaled alignment, fractional device em sizes, wrapping, trimming and complex shaping remain unresolved. The latest native text controls distinguish exact output from bounded residuals and record the completed collapsed monochrome-box fix.
Color adjustment and image effects
- The
HALFTONEstretch mode matches the existing uniform-axis controls for 32-bit output, but Windows takes a second, filtered enlargement branch for some sources. Which branch is a rule of the source rectangle alone (never the destination size, which the 2x and 3x controls vary, the colour adjustment or the blit API) found with boundary sweeps against the native engine (src/emf-gdi-halftone-branch.ts,halftone-boundary.fixture.test.ts): the engine counts distinct colours while scanning the rows and compares the count with limits that depend on the rectangle's size. A colour is the exact 24-bit value, except that colours whose red equals blue are identified by the top six bits of blue and green. Up to 2,304 pixels the branch is always replicated; above 16,384 pixels only rows 0, 6, 12, ... are looked at and 20 distinct colours filter; in between every row is scanned, 145 + floor(o / 16) colours filter (o is how far the least row count with more than 2,304 pixels overshoots 2,304), and so do 20 colours with more than 2,304 pixels in rows that introduced a colour, unless duplicate rows first use up a budget. The rule agrees with every one of the 29,763 swept native sources, with all 242 captured 2x sources and with the single-pixel swap that flips a 256 x 16 band source from replicated to filtered. A source whose height is exactly the least row count past 2,304 pixels (8,766 swept sources, 4,500 of them drawn after the rule for that height was found) needs 289 + floor(o / 8) colours or the 20-colour rule, and the scan gives up as soon as the colours counted plus one row of pixels for every duplicate row reach that limit minus one: one duplicate row before the last colours that are needed already ends it when the rows are wide, while rows that each add only a few colours (2 or 5 per row of a 100 x 24 image) never use the budget and filter at the last row. The filtered branch is reproduced for: enlargements of both axes by up to 5x, whole or fractional (the source is sharpened with the four-neighbour kernel and interpolated vertical first with an 8-bit intermediate rounded half up, a replicated and separately sharpened row beyond the top and bottom; each destination pixel belongs to the source pixel under its centre, the destination pixels of one source pixel form a run, and the three weights come from the run's length and the pixel's place in it: a lone pixel(5,22,5)/32, a pair(4,12,0)and(0,12,4)over 16, a run of three(6,10,0), (1,14,1), (0,10,6), four(6,10,0), (3,12,1), (1,12,3), (0,10,6)and five(13,19,0), (6,25,1), (3,26,3), (1,25,6), (0,19,13)over 32, so a whole factor, 1.5x and 1.025x all draw on the same five sets); either axis enlarged by more than 5x, even by a fraction (horizontal first, the sharpened rows clamped at the edges, the 13-bit shares of the kernel described below, exact for every whole factor from 6 to 16); one axis enlarged while the other keeps its size (only that axis is sharpened, by a one-dimensional passv + floor((2v - l - r) / 4), and interpolated with the same weights, an exact 2x being linear; exact from 1.025x to 10x); mirrored blits (the mirror image of the unmirrored result); and a combined (dithered) colour adjustment (the source and its extension rows are dithered with the ordered pattern and mapped first; for whole factors up to 5x the pattern runs two rows further down than for the replicated branch, and two rows less far when mirrored vertically). All 240 selection controls, the 80 native 2x captures, all 48 cases ofhalftone-filteredand the one-axis profiles of every phase of every whole factor from 2 to 16 on both axes are pixel-exact; the ten dithered cases among them are exact only since round 6 (the source is padded with each edge row replicated twice and dithered, and the chroma stage's measured tie-breaking is applied for the settings inemf-gdi-chroma-tie-data.ts; other colorfulness / tint settings keep a one-level residual in about 0.2% of the channel values). Reducing one axis while the other keeps its size reduces with the same 13-bit shares and sharpens along that axis only (floor(v + (2v - l - r) / 4)on the unrounded reduction, edge pixels standing in for missing neighbours; so a row of 127.5 gives 127, not 128), and despeckles first under the reduction rule below; 150 native stretches of every source kind, size band and mirroring are exact (before, none of the random-data ones were: 99% of the values differed). Under a gamma or log curve the curve is applied to the result (22 of 24 captured, the other two 9 and 15 values off by two levels at most); under a dithered colour adjustment a reduction is dithered and mapped at destination coordinates (pattern unmirrored), and an enlargement dithers and maps the source at its own coordinates (a vertical one sharpens its last row against one further dithered row, a mirrored one counts its pattern rows from the far end) before the one-axis filter: 22 and 23 of the 24 captures of each adjustment are exact (the other two differ by one level in 24 and 4 values), where only two of each were before the chroma ties were applied. A mixed enlarge-and-reduce stretch under a dithered adjustment dithers and maps the source (at its own coordinates) when the destination has at least as many pixels as the source, equal areas included, and the finished output (at destination coordinates) when it has fewer, whatever the factors: 96 captured stretches of every kind with every mirroring are exact (a mirrored vertical enlargement with a reduced width sharpens its last row against one further dithered row at pattern row H - 1 - SH too), where the older even-count rule left 32% to 45% of the values of mixed stretches wrong by up to 200 levels. A mixed enlarge-and-reduce stretch (one axis grows, the other shrinks) runs the reduce, sharpen, enlarge sequence below not only for the reduction by 2x or more that the first captures covered but whenever the shrinking axis loses at least 1.5 source pixels per destination pixel (counted3 * dst + 2 <= 2 * src: 64 to 42 qualifies, 64 to 43 does not, 100 to 66 qualifies, 50 to 33 does not), whenever the source takes the filtered branch, and whenever the destination has fewer pixels than the source (strictly: equal areas do not; a source of up to 2,304 pixels is despeckled first in that last case). Milder reductions of a replicated-branch source pick single source pixels. The despeckle itself is a step only for sources of up to 2,304 pixels and of more than 16,384; sources in between that take the replicated branch are copied without it (the engine's scan hands over to a plain copy). A reduction of both axes follows the same bands: it despeckles first when the source takes the replicated branch (always up to 2,304 pixels, by the scan above 16,384, and never in between) and neither axis loses 1.5 source pixels per destination pixel (a reduction by 2x, as in the checker fixtures, does not); 120 captured reductions of checker-dense, 3-colour and 27-colour sources across the three size bands are exact (98 before), as are all but one of 700 further random ones. All 1,101 native stretches ofhalftone-mixed-enginethat probe these rules are pinned: the 343 engine-grid, 1.5x-boundary and size-band captures, the 120 reductions, 156 of the 160 area-boundary and 154 of the 160 random stretches are exact, the other ten differing by one level in 24 and 13 channel values (float-level boundaries of the enlargement kernel). Stretches at 1.5x, 2.37x, 3.2x by 1.7x, 5.5x and 6.5x by 2.3x of 354 and 171 sources drawn from all twelve groups of the selection sweeps (halftone-boundary) take the branchhalftoneBranchpredicts in every case (one of the 525 differs by 17 of 219,384 values). The replicated branch first smooths exact two-by-two checkers, then takes the nearest source pixel (which diagonal of a checker block is pulled toward its surroundings is decided by brightness 4R + 8G + B, a tie taking the top-left/bottom-right pair: 6,400 native blocks and 500 checker-dense images agree exactly,src/halftone-despeckle-sweep.fixture.test.ts). A reduction averages each pixel's footprint and then sharpens. All seven plain uniform-axis fixtures (2x, 3x, 0.5x, 0.65x and 1.37x) match exactly. Mixed-axis stretching follows the native reduce, per-axis sharpen, then enlarge sequence; all 96 native size/pattern combinations match byte for byte (src/halftone-mixed.fixture.test.ts). The reduction keeps its weights through the sharpening: each footprint is split into 8192 shares, and a source pixel takes the difference of the cumulative sharesfloor(j * 8192 / footprint)at its edges (exact for the native impulse and random-data captures of over 100 size pairs, and for sources up to 300 pixels), and an enlargement other than exactly 2x area-resamples the sharpened samples to destination size and smooths that row with a destination-space FIR that spans one source pixel either way: its taps sample the kernel described below atk / ratiosource pixels and are normalised to 1. The native weights are whole 13-bit shares: the cumulative weight of a destination pixel up to source pixeljis rounded up, a pixel's weight is the difference of two cumulative shares, and a row sums to exactly 8192 (impulse- and random-data-fitted integer weight rows of about 410 size pairs, ratios 1.05x to 8x, and of 78 further pairs, have this structure, and a mirrored enlarged axis reverses the finished rows instead of the source). The kernel is a closed form, found by solving the integer rows of 78 further size pairs (ratios 1.02x to 16x, 8,159 interior rows,halftone-kernel-rows) for the kernel with a linear program, which came out smooth, and fitting the knots: withx = 1 - u(u the tap's distance in source pixels), the weight isx ** (1 / sqrt 2)before half a pixel,xat exactly half a pixel andx ** sqrt 2from there to one pixel, so the two halves are power laws with reciprocal exponents meeting at a jump (0.613 against 0.375 either side of half a pixel). It reproduces 8,152 of the 8,159 interior rows (99.91%) and the output of all 110 rows whose destination pixel centre lies exactly on a source pixel's edge or centre (106 of them as solved weights); the earlier 96-step table fitted to a smaller set reproduced 90% of them and 89% of held-out pairs. Six interior misses are one share between two neighbouring source pixels at a boundary that lies within 0.002 of a whole share (the native engine's float arithmetic: of 4,773 labelled near-integer cumulative shares the formula is on the native side for 4,570, every miss within 0.0035 of the integer; rounding the formula's intermediates to float32 at any site or combination of sites, truncating them, or quantising the weights, the cover, the kernel or the tap distance made it worse or no better). The 110 rows whose destination centre is exactly on a source pixel's edge or centre and the centre phase of the factor 15 are not misses: such a row's two halves weigh exactly 4096 shares, so its output cannot tell the tails (or the spare share of the odd sum) apart, and the converter's rows reproduce every raw native value of 38 of them. A pair of rows (columns) squeezed into one while the other axis grows is despeckled first (a pixel of a one-pixel 2 x 2 checker block becomes the rounded mean of its pair) and, when the other axis at least doubles, keeps only its last row (column), which is then enlarged like any other single-row source; this closes every single-row destination in the captures. Native ramp/checker fixtures retain colour and edge differences there (bounds in the parity tests). The horizontal ramp enlargement is within one level everywhere.StretchBltandStretchDIBitsunder HALFTONE write destination alpha 0 on every branch and never let the source alpha change the colours (alpha 255, 0, 128 and random give identical RGB in 20 stretches under four plans,halftone-alpha.json.gz,src/halftone-alpha.fixture.test.ts): the converter ignores source alpha and writes opaque pixels, as the opaque reference PNGs of the playback captures show, where COLORONCOLOR copies the nearest source alpha. EMR_SETCOLORADJUSTMENTaffectsHALFTONEStretchBltandStretchDIBitscalls, as in GDI. The stages, their order and constants were measured on native 32x32x32 colour cubes: per-channel gamma, reference black/white, contrast (exp(0.0148885 c)), brightness (0.95625 b), log and negative curves match every input level exactly. Illuminants 1-5, 7 and 8 use the native colour cubes; colorfulness and tint scale and turn CIE u'v' chroma exactly (1 + c/100, 0.6 degrees per tint unit) and compress out-of-gamut colours affinely (after flooring the turned u' at 0, which the strongly rotated blues need), with a remaining +-1 rounding difference on about 0.05-0.4% of the channels (for the 11 colorfulness / tint settings measured natively the ties are applied from a table of 1,374 flips,src/emf-gdi-chroma-tie-data.ts, and those settings are exact; the BT.709 matrix is the 7-decimal one derived from the primaries and D65 white; a colour adjustment that combines an illuminant with colorfulness or tint feeds the illuminant's unclamped linear output into the chroma stage, which is within a level on most channels but still up to 70 levels off for a few strongly blue colours). Illuminant, colorfulness and tint go through Windows' 32-level palette with its 66x65 ordered dither, reproduced from native captures including the pattern origin, so the illuminant controls and the combined-adjustment fixtures are pixel-exact apart from that chroma rounding (at most 3 levels) and, for mixed-axis stretches of non-2x ratios, the geometry bounds below. Native captures cover mirrored enlargement, brush origins and rotated/skewed blits; rotated adjustment follows the first HALFTONE blit in the playback session. Direct-DIB colour-band transitions follow the same branch selection (the 144halftone-transitionscaptures, see the parity priorities).- EMF+ image effects (
SerializableObject) are applied to the image's pixels before it is drawn. MS-EMFPLUS does not specify the algorithms, so they were measured against the effected bitmaps GDI+ itself writes into its recordings (src/emf-plus-image-effects.fixture.test.ts). Color matrix, lookup table, brightness/contrast and color balance match the native fixtures exactly. Sharpen strength matches all integer amounts 0–100 independently of radius. Blur: every filter product is kept to 1/256 of a level, the centre weight is applied as two half-weight products that are each rounded on their own, and each sum rounds half up. Below radius 20 GDI+ filters each row horizontally, then vertically filters the leading ceil(height / width) rows, and the converter follows that rule; the native ramp and colour-impulse dimension sweeps are exact. At radius 20 and above, native reduction factors are measured across 957 quarter radii, and the native algorithm is reproduced axis by axis: every row is reduced horizontally (floor of the block mean, a partial last block averaged over its own pixels), filtered at the reduced radius, and enlarged back to full width (linear, truncating, continuing the end line beyond the outermost samples; a single reduced sample leaves one trailing pixel unfiltered); every column of those rows then goes through the same reduce, filter and enlarge. A kernel whose half-width, rounded up to odd, reaches the reduced size (partial block included) clamps at the ends, a narrower one reflects. The kernel weights are float32 values formed in arithmetic that truncates toward zero (the offset accumulates asq_i = q_(i-1) + 1.4 / radius,w_i = exp(-q_i^2), the sum isw_0 + 2 w_1 + 2 w_2 + ...in order, and each weight isw_i * (256 / sum)), which decides every product that lands within a few ten-thousandths of a rounding tie. With them, blur is exact: no pixel differs from GDI+ across random noise images at random radii from 1 to 255 and sizes from 8 to 512 pixels, nor in the ramp, impulse, 957-radius and two-pixel-wide captures, and so is sharpen. Expanded blur reduces a cropped source rectangle from its own corner and enlarges only that rectangle's own reduced samples (the transparent padding samples shape the filtering alone), with samples beyond the buffer transparent rather than reflected; a lone reduced sample is continued toward a transparent neighbour from its block's middle, or from just past the last pixel of a shorter block. The 504 expanded draws and a further 150 narrow and edge-reaching draws are exact. Color curves use complete native lookups for all eight adjustments and every legal intensity, matching all 256 levels. Levels also handles inverted and equal thresholds and the full midtone range; its tables are formed in float32 arithmetic that truncates toward zero and match a 258,560-value sweep and 2.6 million further native values exactly. Hue/saturation/lightness is exact: GDI+ works in all-integer HSL (lightness(max+min)>>1, saturation floored to 0-255, a 255-step hue, 16.16 fixed-point controls) and the converter reproduces it for the whole 16.7 million-colour RGB cube at 20 settings and the 1,390,080-pair sweep. Tint is exact: GDI+ works in integer luma-preserving arithmetic (luma weights 54/183/19 over 256, the tint colour from the 256-index hue palette with a maximum of 254, the amount as a signed weightround(2.55 |amount|)that scales the largest channel byw / 256) and the converter reproduces it for the whole 16.7 million-colour RGB cube at every amount and 20 hues, and the 253,440-pair sweep. Red-eye correction follows a model measured from GDI+'s outputs alone (a clean-room, black-box fit; see the header ofsrc/emf-plus-image-effects.ts): per area, rednessR - max(G, B)is pulled toward grey in 60 six-degree sectors around a centroid of weightsredness / L, whereL = round((9 G + 2 B) / 11)is an integer luma (red plays no part; the weight is 1 whenL = 0, from 2% to 75% of the red pixels at luma 0,redeye-zero-fraction). The centre, radius, falloff and sector means are formed in float32 arithmetic that truncates toward zero (the arithmetic of the blur kernel and the levels tables): centroid sums row by row over pixel indices with half a pixel added to the quotients, a truncated square root for the distance. This replaced the special cases for 'symmetric' scenes (previous weightsG + 0.225 B, a 0.81 carry, a float32 exactness test), which approximated the same rounding noise: with it 77 of 77 nudged 31 x 31 scenes (redeye-nudge, from 59), 191 of 192 independent fresh-process controls (redeye-fresh, from 170; 167 of the 168 with non-zero blue) and 72 of 72 held-out ones (from 71) are exact. A pixel is counted in its sector when its squared distance is below the squared radius and corrected when its distance is below the radius; the two differ for a pixel exactly on the circle in exact arithmetic (the end of a centred axis), which is corrected but not counted. The previous area's centroid, in pixel-index coordinates and before any fallback, is added once to the next area's weighted sums (an area without red passes it on, a red one chains it). A centroid farther from the area's middle than(w + h) / 6is replaced by the centroid of the darkness255 - Lover every pixel of the area, red or not (a uniform area gives its middle; a red band at the top of a field pulls the centre toward it by its share of the weight), and the falloff then is at least0.33 (1 - u), linear in the distance, whatever the strength (the 709 lone pixels beyond the circle of the stage captures are exact with a slope between 0.329 and 0.3325, from 571 with the quadratic falloff alone, and 72 more on 44 x 36 fields of luma spread 0, 30, 60 and 100 are exact with 0.33,redeye-fallback-strength). The stand-in centre is a measurement, not a fit: the native output of the 256 x 64 ramps image of the fixtures is reproduced exactly only by centres inside a box 0.003 pixel wide (127.641 to 127.644 by 30.564 to 30.567) and the darkness centroid lands in it (127.6429, 30.5660; the middle, (128, 32), leaves 362 pixels); pure red ramps in the top rows of grey fields of levels 0 to 150 and band heights 4 to 24 follow it too (redeye-fallback-centre: 23 of 28 captures exact, from 8). The pixels exactly on the horizontal axis through the centroid (both sides and the centre pixel) are one sector group with the 0 to 6 degree sector: the left axis counts as angle 0 rather than 180. Each sector's mean redness sets the correction through a quadratic falloff whose strength steps from 1/4 to 1/2, 0.66 and 3/4 when the area's 30th-to-70th-percentile luma spread exceeds 25, 40 and 80 (0.661 before the float32 arithmetic; 0.66 makes all 30 two-valued fields exact); a second term(1 - D / Dm)^2 / 2with the darknessD = G + 2/9 Bcorrects pixels much darker than their sector (pupils) and is used below twice the sector mean. The one brightest pixel (its luma strictly above every other pixel's and at least 40 above the 70th percentile) is corrected completely, and no pixel near it keeps more than five levels of redness per squared pixel of distance, provided it lies inside the corrected disc (outside it the area has no highlight). Output isR -= round(11/16 a),G, B += round(5/16 a), rounded half up on the final value. The native fixtures are exact: 0 mismatching pixels inplus-only-effect-redeye-left,-bothand-whole(from 3, 59 and 379; the 282 + 57 pixels of the pure-red ramp band, the 80 of the (x, 255 - x, 128) band and the 17 + 3 skin-tone pixels had three causes: the centre of the far-off centroid, the radius that follows from it, and the float32 truncation). The stage captures (redeye-stages,src/emf-plus-redeye-stages.fixture.test.ts) pin the rules one at a time: all 412 lone red pixels inside the fallback circle and all 709 beyond it are exact, as are 120 of 120 centroid-weight captures, 13 of 14 carry captures, 30 of 30 strength fields and 81 of 81 highlight captures. Held-out scenes (redeye-scenes: 36 seeded smooth fields with one to three red clusters, one fresh process each, captured after the model was fixed) are exact in 30 (17 with the previous model). Process state is not what left the fixture residuals: native playback of the recordings is the committed reference in every fresh process whatever came before it (redeye-playback: 17 contexts, 32 playbacks, 0 differing pixels), and the effect applied to the generator's own eyes and ramps images in a fresh process is the same bitmap (redeye-fixture-direct, 8 of 8 exact). Not reproduced by a stateless converter: a directGdipBitmapApplyEffectcall that follows a two-valued field of 16 x 16 pixels or more in the same process and holds red pixels of luma 0 with no other spread information (a pure-red area) takes its strength from stale memory of the earlier call. The same sequence run in separate fresh Windows processes (redeye-state: 30 sequences, 6 processes each) gives different outputs for 7 sequences: a pure-red 24 x 24 area after a spread-120 field removes 91 levels of red at its middle pixel in five processes and 30 in the sixth, and the first call of a process is exact in 180 of 180 captures (a pure-red area gets strength 1/4), so the model is what a fresh process does. Also not reproduced: areas whose red centroid is far from the middle in bright fields (grey fields from level 151 correct nothing at 128 x 128 and another set of 207 pixels at 256 x 64; six of the 36 held-out scenes, 8 to 952 pixels off: the stand-in centre does not explain them), and rounding-sized pixels (one in a noise-field scene, 4 and 1 pixels of black fields of 128 and 160, one carry-capture pixel whose value lands 8e-6 above a half, and the 75%-luma-0 noise field ofredeye-zero-fraction, 75 pixels: 38 of 40 captures exact, from 30). - EMF+ image effects run on the premultiplied playback bitmap. A recorded effect (the baked bitmaps in each Dual fixture) runs on the straight ARGB bitmap, but when GDI+ plays a metafile back each translucent colour has been premultiplied (rounded) and the effect sees it restored by truncation (
floor(round(c a / 255) 255 / a)); the effect's output is then composited with rounded premultiplication.EffectAlphaProbe.cs(effect-alpha,src/emf-plus-effect-alpha.fixture.test.ts) draws a 256 x 256 grey-level-by-alpha source through nine effects both ways: straight ARGB sources composite exactly like the model in all 1,769,472 values, and premultiplied sources over black agree in 99.0% to 99.5% of the 196,608 values of each effect (every alpha-128 value exact) against 71% to 83% without the step. The restore is exact for the half-transparent bar of the fixtures, and about 1% of the other alphas are one or two levels low wherep 255 / ais an exact integer (a float rounding that was not identified). This closed the 96 half-transparent pixels, one level off, of 30plus-effect-*/plus-only-effect-*fixtures (tint, levels, colour matrix, colour LUT, colour balance, hsl, brightness/contrast, sharpen) and the 8 to 56 pixel blur and sharpen residuals (blur-r1,r2p5,r3,r10and their expand variants,sharpen-r6-a30): 687 of 870 report comparisons are exact, from 646, and every Only recording but the rotated blur is exact at tolerance 0 (their tolerances were 1 to 3 levels). - EmfPlusDual recordings add a processed bitmap fallback after the effect draw. EmfPlusOnly recordings carry the effect and original source without that fallback. Both types have been regenerated and tested: 74 cases each, plus an explicit Dual blur case. Only recordings test the effect algorithms directly (red-eye included). Deferred PNG and SVG draws preserve their effects and cropped source mapping.
- An effect is applied to the draw's source rectangle only, reading one more column and row, as GDI+ does. A blur with
expandEdgeblurs transparency in at the edges but, as in GDI+, draws nothing beyond the source rectangle. MS-EMFPLUS requires pixel source units; malformed non-pixel records do not apply effects. - GDI+ records a color curve effect under the lookup table's identifier, and its own playback then draws the image without the effect. The converter does the same.
- An effect is skipped when the image cannot be decoded to pixels. PNG, BMP, JPEG, GIF and TIFF have bundled decoders. Animated GIF and multipage TIFF initially draw their first frame/page, as GDI+ does. Native references verify offset GIF frames, background colours, transparency, local palettes, LZW-compressed and multipage TIFF, plus odd-width bilevel uncompressed, PackBits and CCITT Group 3/4 TIFF. Group 3 also handles reversed bit order and multiple strips. Deflate strips (both compression tags and horizontal prediction) and uncompressed/Deflate tiles also match native references exactly. JPEG-compressed TIFF strips and tiles (RGB and YCbCr) and standalone JPEG (greyscale, RGB, 4:4:4, 4:2:2, 4:2:0, progressive) match the native references exactly: the bundled decoder reproduces libjpeg's accurate integer IDCT, triangle chroma upsampling and fixed-point colour conversion. Arithmetic-coded JPEG is decoded by the bundled decoder and matches GDI+ exactly on the libjpeg-turbo sample and on 23 encoder-made native captures (
scripts/gdi-fixtures/arith-jpeg-encoder.ts, a port of libjpeg'sjcarith.c): sequential and progressive (spectral selection with and without successive approximation), restart intervals, custom DAC conditioning (including extreme L/U/K values), 4:4:4, 4:2:2, 4:4:0 and 4:2:0 sampling, greyscale, and two images (the 37 x 19 pattern and a 61 x 45 high-magnitude noise image). GDI+ refuses none of these variants. Arithmetic CMYK and YCCK (sequential, progressive, restarts) decode to the same pixels as a Huffman copy of the same coefficients and go through the CMYK conversion described below. A 12-bit JPEG cannot be decoded by Windows either ("Unsupported JPEG data precision 12"), and GDI+ draws nothing for it; the converter does the same, in PNG and SVG output. CMYK and YCCK JPEG (Adobe transform 0 or 2, or no Adobe marker, whose samples are always read as inverted) are converted the way Windows does it. GDI+ sends them through the Windows ICM colour-management module (mscms.dll, the RSWOP CMYK profile to sRGB, perceptual intent, best-quality transform: byte for byte whatTranslateBitmapBitsreturns), which resamples the profile onto a 16 x 16 x 16 x 16 table of 16-bit integer colours, interpolates it tetrahedrally (the four fractions sorted in descending order) and keeps(S + 4096) >> 20of the weighted node sumS(integer weights summing to 4096). Where an ink sits on the grid is the profile's own input curve: the A2B0 tag of RSWOP.icm carries a 256-entry table per ink (the same four times),t(0) = 0,t(v) = 256 v - 1up tov = 224, then a steeper line tot(255) = 65535(cmykInputCurveinsrc/jpeg-cmyk.ts, checked against all 1,024 table entries bygenerate-cmyk-lut.ts curve).TranslateColorsaccepts 16-bit ink words (aCOLORrecord is 16 bytes in a 64-bit process, 8 in a 32-bit one); for257 vit returns the 16-bit colour of the 8-bit inkv. The module takes a wordwtox = w - (w >> 8) - 2, steps through the profile table cut into 16 steps per entry (plus one, but for the first entry) with the weightr / 15of the low four bits ofx, and the result is a grid position in whole 1/4096 cells (15 k + rbelow cell 13;cmykInputPositions:240 v - 1for the 8-bit inks up to 224, a steeper run to the last nodes,v = 255exactly on node 15), so the interpolation weights are integers. Found by a sweep of every 16-bit word along the 32 edges of the ink hypercube (scripts/gdi-fixtures/cmyk-edge-sweep.py;icm-cmyk-edges.bin.gz,src/icm-cmyk-edges.fixture.test.ts): blocks of 16 words with weights r / 15, one extra repeated word every 256 words, and a once-rounded line of the interpolated node value that is not a straight line of the 16-bit output, because the 16-bit result passes through a 1,025-entry output table,p = (n 65472 / 65535 + 511/1024) / 64intoK[m] = (65599 m + 511) >> 10interpolated linearly, which adds one level every 1,040 levels spread over 64. The 8-bit result does not use that table: it is(S + 4096) >> 20, which is why it differs from the top byte of the 16-bit one for 0.08% of values (always where the 16-bit word ends in 0x00 or 0xff). The 65,536 nodes (signed 16-bit integers, nodes beyond the sRGB gamut unclipped) are the module's own: a 16-bit probe placed exactly on every node (the wordwwith position4096 jper ink) reads back through the output table to the node value, and the clipped, ambiguous and unreachable read-backs (2,968 of 65,536 nodes) and the last few nodes are refined against 19 million native conversions byscripts/gdi-fixtures/generate-cmyk-nodes.py(exact 8-bit interval constraints, heaviest weights first, then the 16-bit conversions for what 8 bits cannot decide; the RSWOP profile itself, which Windows ships, is not bundled).src/jpeg-cmyk.tsbundles the table (about 275 KB of text, 79 KB more than the fitted 196 KB one). Every channel of the CMYK and YCCK patch, ramp and photo references is exact (all 8 files, 49,152 or 18,432 channels each), as is the TIFF strip file and the 8,000 committed samples; on 30,000 held-out random inks (icm-cmyk-val.bin.gz) none is wrong, and on 10,000,000 fresh random inks (not committed) 43 of 30,000,000 channels differ by one level (the earlier fitted table: 0.26% of them), all at a byte boundary of a node sum, mostly with a node beyond the gamut among its five. CMYK JPEG inside a TIFF (PhotometricInterpretation 5) goes through the same transform with the ink amounts read as stored, not inverted (96 x 64 reference: exact). Chroma subsampling and Adobe/no-Adobe variants behave like the exact decoder; the earlierjpeg-jsfallback matched 1% to 11% of CMYK channel values with errors up to 135, and the 17^4 grid fitted to GDI+ output before the transform was identified matched 87% to 95% with errors up to 6. Canvas backends are bypassed for these families, so@napi-rs/canvasand browsers cannot change the result; in SVG output such files are embedded as decoded pixels rather than as the original JPEG. A canvas backend remains preferred when available. Other encoded formats may need a browser or@napi-rs/canvas. - CMYK 8-bit result: exact for all 2^32 ink combinations. The module's 8-bit routine reads unsigned 16-bit nodes and returns
S >> 20of the weighted sum (output table entryS >> 18);nodeTable8insrc/jpeg-cmyk.tsis the 16-bit-probe table plus one, clamped to 16 bits, withNODE_DELTA_8BIT, 89 corrections to interior nodes (47 of -1, 32 of +1, nine of two to five units) found byscripts/gdi-fixtures/cmyk-8bit-nodes.ts(exhaustive native sweep, then a boundary-constraint solve, repeated until a sweep finds no wrong ink). The 16-bit probes (cmykColour16) read the module's generic interpolator and keep the original table.icm-cmyk-fit8.bin.gzandicm-cmyk-heldout8.bin.gzpin inks the uncorrected table missed.
Pen transforms
EMF+ pen transforms (uniform, non-uniform and skewed) match GDI+ exactly on the 17 pen-transform fixtures. That includes dashes, which GDI+ lays out along the path in world space at the untransformed pen width. Native fixtures verify dashes under uniform and non-uniform scales, including antialiasing. GDI+ rejects singular pen transforms; the converter ignores such malformed transform data. Square, round, diamond and arrow anchor caps use their native shapes; the new centered-cap fixtures match every pixel with and without antialiasing.
Clockwise inside-frame RoundRects round vertical inset widths up and curve controls up, with horizontal half-FIX shifts applied in both arc directions. emf-insideframe-scaled and wmf-shapes-scaled are now pixel-exact. In GM_ADVANCED an Arc, Chord or Pie under an inside-frame pen wider than its box paints nothing and has an empty path (as measured with a DIB probe and GetPath), where an Ellipse, Rectangle or RoundRect keeps the box as given. 2,400 native GetPath captures at fractional scales (emf-scaled-paths.json.gz) match every shape, counter-clockwise and clockwise, point for point. A pen exactly as wide as the box leaves a zero-size frame: an Ellipse, Rectangle and RoundRect still match (the corner geometry is scaled onto it; one RoundRect is a FIX off), while Windows builds an Arc, Chord or Pie there from rounding noise, which is not reproduced. In GM_COMPATIBLE (WMF) a pen wider than an Ellipse or RoundRect leaves the box without the pen's inset.
Text
The 12 October follow-up fixes supplementary Unicode in supplied-font EMF+ DrawString: surrogate pairs now select one cmap glyph and receive one advance, including vector SVG positions. All 75 new native controls match complete RGBA output. This does not add complex-script shaping, fallback fonts or color emoji. Courier New AntiAlias and monochrome dropout control for straight single-contour outlines also improve, with remaining per-case differences explicitly measured. Long ClearType string compensation remains unresolved; candidate spacing changes were rejected after mixed-string regressions. See the native parity review for current measurements and the small known tradeoffs. The 15 October monochrome follow-up makes GDI non-ClearType hinting use GDI's own interpreter arithmetic (projection and move rounding, IUP, degenerate freedom vectors), the single-rounded cell-height mapping, GDI's synthetic-italic shear and implied-point rounding on the 26.6 grid. Exact fixtures in the GDI report rise from 646 to 659 of 870 with none worse (for example textx-arial-mono 76 to 29, textx-segoeui-cell-mono 189 to 49, textx-plus-singlebit 394 to 125 once GDI+ SingleBitPerPixel snaps glyph origins to whole pixels), and the Tahoma condensed set rises from 970 to 1150 exact of 1200. ClearType and GDI+ hinting keep the previous arithmetic. Rotated glyphs (round 8) are hinted unrotated at the whole-pixel ppem GDI uses for the rotation and then rotated, the pixel centres that lie exactly on a diagonal edge follow the contour's direction, rotated fonts have their own tmAscent / tmDescent and quarter-turn advances round half up at 1/32 pixel: textx-rotalign-esc-small 207 -> 13 px, textx-rotalign-esc and -world 34 -> 15, textx-world-aa / -mono 13 / 12 -> 3 / 2, rotate-text-25deg exact against the native playback (see "Round 8" in the parity log notes); the exact minor ratio of the rotation and Tahoma's rotated curves remain (round 9: the escapement's sine and cosine are a 128-step chord table, now used for the glyph outlines). Still open: ISECT on non-axis-aligned lines (431 of 960 native controls), about 140 of 6740 sheet glyphs that differ by dropout or stub decisions, and (settled in round 9) GDI+ advance accumulation: the misplaced glyph clusters of textx-plus-singlebit were design-unit advance rounding, 125 to 30 px. The textx-eto, escapement and world references are direct drawings, not native playback, so their residuals are not playback differences.
The round 10 GDI text follow-up (22 October 2026): integer advances follow head.flags bit 4 and the LTSH table (native widths of five faces at 214 heights: 4,731 of 239,680 differed, none now), so WMF playback of Times New Roman is exact where it was 21 to 24 pixels off; GDI's interpreter keeps the left phantom point unrounded and rounds the advance, and a bitmap is placed from the point's starting position plus the whole pixels a program moved it by (Times New Roman Italic < >, Microsoft Sans Serif 7). Remaining mono and grayscale residuals of one pixel or one sample are native curve-flattening ties that none of the tried subdivision schemes reproduces; see docs/parity-log.md, Round 10 (workstream C).
Grayscale GDI+ glyph origins now snap independently to the nearest quarter pixel in x and y, verified on native sweeps at 1/64-pixel intervals. ClearType snaps horizontal placement to the nearest sixth pixel and preserves that fraction through scan conversion, while vertical placement snaps to whole pixels. ClearType hinting honours the size-specific x shifts (SHPIX) of Arial, Times New Roman and Tahoma that native applies to stems and curves, and ignores y DELTAPs once IUP[y] has run (also in grayscale): 2,247 of 3,720 native captures (10 faces, 12 sizes of 9 to 24 px, 31 characters; src/gdiplus-cleartype-sizes.fixture.test.ts) were pixel-exact after these two rules, 2,015 before, with one lost (Times New Roman Bold 17 px 2, one sample of a serif tip); the round-6 rules below bring the sheet to 3,059. Diagonal/base glyph hinting still differs, by up to a sixth of a pixel at diagonal and curved edges. DrawString placement has no known defect: of the 144 native placement controls 96 are exact, and the 48 that are not (W and g at Arial 16/40 px and Times New Roman 22 px) differ identically at both quarter-pixel phases and are not improved by any whole-pixel shift, so they are glyph shapes. The compatible-mode playback stretch of recorded text (eyScale / exScale, 989 pixels of textx-segoeui-cell-mono) is deliberately not applied: it belongs to the playing device, and applying it would turn that sheet inexact against its direct-drawing reference.
- The ANSI, small-text and multi-string record fixtures retain glyph-edge differences under 0.1% (
src/emf-text-records.fixture.test.ts). PolyTextOut C1 handling now follows native playback; focused Courier controls are exact and Arial retains three edge pixels. EMF+ masks retain decorations and use native grayscale hinting and 16 shades; 150 grayscale and 34 ClearType baseline-controlled glyph captures, plus every captured contrast mapping, are exact. Broader ClearType, antialiasing and TextContrast fixtures still differ, including diagonal hinting and fractional positioning. Current fonts reproduce the threetextx-plusantialias/ClearType references exactly, so those residuals are renderer differences; other old captures lack complete provenance. - ANSI text is decoded by the LOGFONT charset: ANSI and DEFAULT with the playback device's ANSI code page (
ansiCodePage, 1252 unless set; a metafile does not record it), Mac, Shift-JIS, Hangul, GB2312, Big5, Greek, Turkish, Vietnamese, Hebrew, Arabic, Baltic, Russian, Thai and East European through the host'sTextDecoderwith the matching Windows code page, Johab and OEM from bundled Windows tables (OEM uses the playback device's OEM code page,oemCodePage, 437 unless set), Symbol as raw byte codes. Unknown charset values fall back to Windows-1252. - Vertical
ETO_PDYadvances are supported with or without thefontsoption. - Windows raster faces (
.fon) follow native GDI for size choice, stretch, bold and italic synthesis and underline/strike-out bars: all 3,920text-raster-stylescaptures (seven faces, seven heights, every bold/italic/underline/strike-out combination) and everytextx-fon-*fixture (includingtextx-fon-courier-styles, with itslfWidthlines) are pixel-exact with the fixture font set (plus8514sys.fonand8514fix.fonfor the 120 dpi System and Fixedsys sizes of the.regenreferences). The mapper that picks the face and the whole-number stretches (src/raster-mapper.ts,raster-mapper-synthetic.json.gz) reproduces 99.8% of 5,040 nativelfWidthrows of the non-Terminal faces (5,028; the 12 others are near-ties) and 746 of 784lfWidthstyle captures; the other 38 captures and 391 Terminal rows differ because native Windows maps Terminal over more OEM.fonsizes (8 x 8, for one) than the fixture font set supplies, not because of the rule. All 980lfHeight61 to 130 rows and all 1,200 height rows of the 144 dpi capture are picked exactly. MS Shell Dlg is drawn from Microsoft Sans Serif outlines, not a raster face, and keeps its TrueType hinting residuals (84, 34 and 8 pixels in the three fixtures). - Without
fonts, SVG text measurements are estimates. Supply the matching fonts for exact justification. - GDI grayscale text (ANTIALIASED_QUALITY) blends exactly as native: transparent text is
d + floor((s - d) * a)per channel with a coverage- and direction-dependent weight, text drawn with its background (OPAQUE mode, orETO_OPAQUEover a rectangle that contains the text cell and its glyph bitmaps) goes through an 8-bit linear domain (src/gdi-gray-blend.ts; 0 mismatches over the native grey grids and 20 million random channel samples). What is left of the AA text sheets is glyph coverage: converter hinted outlines differ from GDI's by 1/64 to 3/64 pixel at points set along diagonal strokes, in about a quarter of the glyphs of Arial, Times New Roman, Tahoma and Courier New at 18 px and above (src/gdi-gray-glyphs.fixture.test.ts). - Grayscale text (GDI
GGO_GRAY4_BITMAP, GDI+ AntiAlias and AntiAliasGridFit) follows the font's dropout control including the stub-excluding types 1 and 5 without FreeType's overshoot exemption; the monochrome rasterizer keeps the exemption (it moves 524 private-font bitmaps to exact and 400 away). - GDI+ grayscale text (AntiAlias, and AntiAliasGridFit where
gaspsmooths) runs the ClearType interpreter and answers GETINFO as gray ClearType (ClearType and selector 4096 set, grayscale not), which the converter reproduces (15,747 to 17,113 of 31,584text-real-glyphscaptures exact,src/gdi-getinfo.fixture.test.ts); AntiAliasGridFit spaces glyphs by GDI's own interpreter widths and default-format ClearTypeGridFit by the ClearType phantom-point advance rounded to a pixel (src/gdiplus-text-advances.fixture.test.ts). The generic per-size SHPIX helper functions stop shifting once IUP[y] has run, and ordinary SHPIX shifts of points never touched in y, which native honours, are still skipped (six private kinds,src/ttf-shpix-order.fixture.test.ts; dropping the rule trades 182 real-glyph and 117 Courier New ClearType captures for 45 worse baseline strings). Diagonal stems throughSDPVTLandMIRP(ArialW,k,y,v,w,x,A) still differ from native by a unit at one instruction (function 20 of Arial'sfpgm), and GenericTypographic ClearType strings keep the GDI widths because the run's end compensation is not modelled; AntiAlias underlines were drawn on whole rows where native uses quarter-pixel bars (closed in round 9, below) (docs/parity-log.md, "GDI+ text (round 8, R2)"). Round 9 (W2): (1) unhinted GDI+ DrawString (AntiAlias, SingleBitPerPixel) advances a glyph byround(hmtx advance x 1.03)font units at an identity transform (Ariall: 455 x 1.03 = 468.65, 469 units; probeSingleBitAdvanceProbe.cs, 256 of 256 Arial and Segoe UI bar strings agree,src/gdiplus-singlebit-advances.fixture.test.ts), which was the whole of the "mispositioned clusters" oftextx-plus-singlebit(125 to 30 differing pixels) and most oftextx-plus-antialias(276 to 42 after the bars); at other scales the unrounded advance stays (the scaled-alignment controls regress with the rounded one). (2) AntiAlias underline and strike-out bars aremax(1, round(thickness))rows thick with the top edge atbaseline + position - (thickness - 1) / 2, truncated to 1/512 pixel and raised to the next quarter pixel, coverage in 32 levels, not contrast-adjusted and combined with the glyphs as1 - (1 - glyph)(1 - bar): all 4,495 underline and 1,160 strike-out column profiles and, for bars of two or more rows, every start and 1,939 of 1,968 ends agree; the thin one-row bar's sub-scanline dependent ends are approximated (src/gdiplus-underline-bars.fixture.test.ts, 8,000 captures; Tahoma's synthesised italic is a quarter row off at three sizes). (3) GDI+ ClearType text is blended with 8-bit tables, not a float gamma-space mix:lin[v] = round(255 (v/255)^gamma),mix = lin[bg] + round((lin[fg] - lin[bg]) k),out = round(255 (mix/255)^(1/gamma)), with k in exact sixths (the filter's 127 is one half), an uncovered channel keeping the background and an all-channels-covered pixel the text colour; 1,843,077 of 1,843,600 sixth-level pixels of 80 native colour/contrast draws agree (src/gdiplus-cleartype-blend.fixture.test.ts):gpx-text-texture-cleartype161 to 0 (exact),gpx-rec-textcontrast-cleartype1,898 to 76,textx-plus-cleartype361 to 26. (4) Native GM_COMPATIBLE playback stretches text by eyScale / exScale read from the record (patching the two equal makes native playback equal the direct drawing), and Segoe UI re-grid-fits the nine cell heights whose stretched size passes the window rule: the converter now does the same (textpb-segoeui-cell-q34,095 to 93 pixels from the playback;textx-segoeui-cell-monogets a native playback reference). The diagonal-stem residual ofW,k,y,v(302 and 76 pixels in the twogpx-rec-textcontrastsheets) stays open (see the parity log notes). - GDI+ text of installed fonts follows DirectWrite's ClearType interpreter arithmetic (per-product projections, every projection vector but exactly y is the ClearType direction); this is the default (
GdiFontCollection'sinstalledFontsoption, true unless a collection of private fonts says otherwise) because it gains about 2,090 of the 31,584text-real-glyphscaptures net of 6 losses (and 352 oftext-coveragenet of 30 Arial 16y), closesgpx-rec-textcontrastand takes the GDI+ ClearType size sheets from 3,079 to 3,324 exact (2 lost). It raises DrawString ceilings elsewhere (the aligned-string, scaled and cell-baseline controls: 184 + 198 ceilings; Courier New 12H I n x 0175 to 176 andIIIHHHnnnxxx000609 to 615 pixels), listed in docs/parity-log.md. Private-collection and per-user-installed fonts render with other arithmetic natively and are not modelled by it. See docs/parity-log.md, round 11 R11-C. - GDI+ grayscale text drawn at an identity world scale now honours the inline SHPIX along x that Arial Bold's
y,W,kand2use to move stems a quarter or half pixel (round 10, R10-B;HintedSize.plusShpixX,src/gdiplus-shpix-x.fixture.test.ts): 17,014 to 17,409text-real-glyphscaptures exact with none lost,gpx-rec-textcontrast302 to 48 differing pixels,gpx-text-textureexact. Shifts of untouched points under half a pixel and of points touched in both directions before the IUPs stay skipped (they cost pixels in situ), and under a non-identity world scale none are applied (the scaled alignment controls get a few pixels worse). RemainingW,k,ydifferences are single pixels where one of 16 samples lies within 1/64 px of a hinted edge; seedocs/parity-log.md, "GDI+ text (round 10, R10-B)". - Round 9 scan conversion: a grayscale sample row that lies exactly on a horizontal edge is inked (the union of the spans just above and below; 12 more Segoe UI gray bitmaps of 2,068, 11 more of 31,584 real GDI+ glyphs, none lost), the ClearType stub test reads the specification's squares instead of FreeType's profile rule (3,076 to 3,079 of 3,720 size-sheet captures) and glyph outlines under an lfEscapement are rotated by the 128-step chord table GDI uses (
escapementSinCos; 3,600 native angles to 2e-5). The same squares rule for monochrome and grayscale dropouts (6,600 to 6,718 of 6,740 real mono sheet glyphs, 51,971 to 61,465 of 61,952 private mono controls, 38,753 to 43,309 of 56,320 gray ones) is applied here and gives up 20 controls that were exact (18 private mono ones, one private gray glyph, one Segoe UI 48 px gray bitmap), all with a contour within about 0.004 pixel of a pixel centre; they are pinned by name insrc/ttf-mono-squares.fixture.test.ts(docs/parity-log.md, round 9 W3). - Backward-compatible ClearType, and the GDI+ grayscale text that runs the same interpreter, reads storage 8 as 0, so the Monotype fonts' small-size block of corner-squaring calls never runs (
src/ttf-hinting.ts; why native treats the flag as clear is not known). - GDI+ SingleBitPerPixel (no grid fit) glyphs have no glyph program and scan-convert with simple dropout control, stubs excluded (mode 1), not the default of dropout control on up to 32 ppem; sweeping modes 0, 1, 4, 5 and none on
textx-plus-singlebitgives 30, 0, 48, 22 and 22 differing pixels (round 12;UNHINTED_MONO_DROPOUT). The grid-fit hint keeps the font's own SCANCTRL. Native state check:textx-plus-singlebit,-antialiasand-antialiasgridfitwere redrawn in four fresh processes and are byte-identical to the fixtures every time;-cleartypecame out as two different images across the four processes (one equals the fixture), so some of its remaining pixels may be native state. - GDI+ grayscale text of installed fonts at an identity world scale is scan-converted with GDI's own scan converter (
msGrayBitmap, the one GDI grayscale uses) instead of the older 4x oversampled rasteriser (round 12):text-real-glyphs19,496 to 19,649 exact, the private polygon fonts' AntiAlias sets 3,709/3,712/4,028/4,046 to 3,945/4,059/4,096/4,096 of 4,096 at the small sizes, Georgia 1,118/901 to 1,124/911 of 1,128,textx-plus-antialias12 to 9 and-antialiasgridfit5 to 4 differing pixels. Text under a world scale other than 1 uses it too (accepted trade:emf-plus-text-alignment-scalegains 27 exact captures, 25 Arial and 2 held-out Arial, and loses none, but Arial 16 px at 1.25 "AV" goes from 129 to 130 differing pixels, so that one ceiling was raised); collections of private fonts keep the old rasteriser (installedFonts: false; the private diagonal-hinting coverage ceilings would be exceeded). - ClearType text follows the font's own dropout control (
SCANCTRL/SCANTYPE, stubs excluded for types 1 and 5) on its 6 x 1 samples: 3,076 of 3,720 native size-sheet captures are exact with the storage 8 rule and the helper SHPIX rule (3,059 before round 8) (2,369 before the dropout control, 2,890 with the dropout control alone, 2,247 without either), with two recorded losses (Arial 11 px g and Tahoma bold 18 px y, a geometry coincidence of our thin tail ends) (src/gdiplus-cleartype-sizes.fixture.test.ts). A font that never runsSCANCTRLkeeps no dropout control under ClearType although native applies one to some of its glyph shapes, and GDI+ AntiAliasGridFit of a font without agasptable runs no glyph programs in native. - GDI+ ClearType draws the system Courier New half a pixel wider than its outline and the converter reproduces this (a sample-row widening keyed on the family name,
src/gdiplus-cleartype-courier.fixture.test.ts: 1,119 of 1,976 native captures exact (951 before the dropout control, 1,114 before round 8), the straight-edged glyphs 237 of 248). Curved Courier New glyphs retain edge differences of one to a few samples, and GDI's own ClearType (not GDI+) of Courier New is not widened because it has not been measured. - Round 11 GDI text (monochrome and grayscale, not GDI+ or ClearType): glyph bitmaps come from a reimplementation of the native scan converter (
src/ttf-msscan.ts) and the hinting arithmetic of ISECT, MUL, IUP and SCANCTRL follows the system rasterizer; 6,740 of 6,740 native monochrome sheet bitmaps and 2,068 of 2,068 native grayscale ones are exact. Where two grayscale glyph bitmaps of one run overlap, GDI ORs their stored values (level - 1, 4 bits; round 12), so those pixels are exact too. Remaining differences are a few rotated glyphs at small sizes (round 12: the playback stretch was the one-unit difference of the escapement fixtures; the whole-pixel hinting size is still open at ties). See docs/parity-log.md, round 11 workstream B and round 12. - Dropout control in glyph bitmaps follows the font. A font that never runs
SCANCTRLis scan-converted by GDI with simple dropouts up to 32 ppem and none above (private program-free polygon fonts,GetGlyphOutlinemonochrome bitmaps: 4,079 of 4,096 match at 8 to 32 ppem and all 1,024 at 33 to 40; the same with a stack declaration, a glyph program, acvttable or an emptyprep), and grayscale bitmaps apply the font's ownSCANCTRL/SCANTYPEto the 4x4 oversampled outline. The converter models the monochrome default and the grayscale types 0 and 4 (Georgia, which selects 4: 1,053 of 1,128 AntiAliasGridFit glyphs and 782 AntiAlias ones are exact, 1,042 and 736 before round 8's gray ClearType GETINFO answers and 942 and 476 before the dropout control;src/ttf-gray-dropout.fixture.test.ts) and, since round 6, the stub-excluding types 1 and 5 that Arial, Times New Roman, Segoe UI, Courier New, Tahoma and Verdana select, in grayscale and under ClearType (see the two bullets above). Its stub rule for monochrome bitmaps is still partial (about three bitmaps in four are right, glyphs with several dropouts near one tip being the miss). It does not yet model the grayscale default for a font withoutSCANCTRL, or GDI+ AntiAliasGridFit's monochrome bitmap from 9 to 17 ppem for a font without agasptable. In the committed private-font coverage sets the monochrome default makes, for the bilevel hint (SingleBitPerPixelGridFit), 190 of 192 opcode controls exact at 16 ppem (0 before), 170 at 23 and 32 (0 and 24), and 104 of 108 diagonal controls at 23 and 32 ppem (1 before). - GDI ClearType at default quality keeps the black-and-white advance widths, and glyph programs see that width: the advance phantom point sits at it, and every stem a program sets with MIRP or MSIRP between two glyph points is moved rigidly (both edges and the points that follow them) by the pair's centre times BW / natural advance - 1, keeping its hinted width; GETINFO reports symmetric smoothing (bit 18) at the sizes whose
gasprange asks for it (src/ttf-hinting.ts,src/gdi-cleartype-width.fixture.test.ts; 8,418 native captures of eleven private-font sets).textx-arial-ctnaturalfalls from 4,034 to 687 differing pixels,textx-arial-cleartypeand its q0/q1/q2 variants from 11,272 to 7,146,textx-segoeui-cleartypefrom 10,981 to 4,372 andtextx-color-cleartypefrom 867 to 595; of the 420 Arial glyph captures ofgdi-cleartype-compat.json.gz146 are exact at default quality (81 before, 3,324 differing pixels, 6,296 before) and 349 at natural quality (320). Round 9 explains most of what was open, and the converter does not yet apply it: native shifts a stem as the program runs, so a point that MDRP, ALIGNRP, MIRP, SHP or IP places from a shifted stem point inherits the shift through the geometry (a projection vector set perpendicular to an arm with SPVTL / SDPVTL is read from the shifted points, so a point placed along a diagonal arm follows by the share its height gives and the apex hardly moves), the absolute measures of a program (MDAP / MIAP rounding, GC, MD, the ratio IP interpolates) see the unshifted outline, and a stem the program sets after IUP[x] is never shifted (private fontsbuild-cleartype-arm-fonts.py,gdi-cleartype-arm.json.gz,src/gdi-cleartype-arm.fixture.test.ts). Two commits that implement this (feat: leave a stem the program sets after IUP[x] where the program put it, thenfeat: run the ClearType compatible-width stem shifts on the live outline, branchesw1-candidate-postiupandw1-candidate-immediate-shift) are withheld because the second makes 7 of the 1,260 exact default-quality captures inexact (1 to 4 pixels each) while making 54 exact; see "GDI ClearType past the stem (round 9, W1)" in the parity log notes. Still open either way: which chain MIRPs native counts as a stem (the 4 to 7 pixel wide, steep ones between a valley and an arm top of 'V', 'W', 'X', 'x' are not shifted by native), 't' (two flat caps native does not shift), Arial 11 to 16 px, where the font's own per-size SHPIX tables for the compatible mode apply, and Segoe UI 'm'. Round 10: only a MIRP of black distance type (flag bits 0 and 1 = 01) is a stem, and a point already in a stem pair is not the first edge of another (the later point scales with its own position), which takes Arial's diagonal letters from 6,034 to 3,886 differing pixels ontextx-arial-cleartype; the shift scale for a fractional hinted advance, a first corner on the origin, the MDRP/IP steps after the chain and Segoe UI's centre formula stay open (see parity log). - Round 11 replaced the compatible-width stem model with the mechanism read from
fontdrvhost.exe(links recorded during the program, resolved once at the first IUP[x]), the native ClearType-direction flag (any projection vector but the y axis), the 4 9 10 9 4 vertical filter and the oversampled-grid curve rules for GDI ClearType:textx-arial-cleartype3,886 to 218 differing pixels, Segoe UI 4,264 to 261. Remaining differences are Arial 12 and 13 pxa e s oat default quality, a few@ 3 0 $ sglyphs and GDI+ ClearType, which keeps the old direction test. - Round 12 rotated text under native playback: a GM_COMPATIBLE text record stores exScale / eyScale, and native playback stretches the text space along x by their ratio (1.000558 here) before the escapement turns it, so the rotated glyph matrix is
rotation * diag(k, 1)(notdiag(k, 1) * rotation, which is what a GM_ADVANCED world transform gives and whatGetGlyphOutlineunder one reproduces). Each of the two axis vectors is divided by its own major component, both rounded to the 1/32-pixel grid of a 2048-unit em as before (rotationMatrix). That was the "one 16.16 unit" oftextx-escapement-aa/-mono: both are now exact (5 px each before; 887 of 910 report comparisons exact, up from 885, none worse), and a new sweep of native playback of 25 sheets (Arial, Times New Roman, Tahoma, Segoe UI and Courier New at 12 to 36 px, 50 escapements, 8 single glyphs each,text-escapement-playback) falls from 910 to 72 differing glyph cells of 10,000 (about 1,490 to 400 pixels; measured on a 25-sheet set that also had 28 px, 20 sheets are committed). What is left in those sheets sits on whole lines at 12 px and on a few lines at 9, 13 and 14 px whereppem * majoris within 1/64 of a half pixel and the whole-pixel hinting size is not a function of that value alone (see docs/parity-log.md, round 12). - Round 12: at default quality (compatible widths) a y SHPIX made after IUP[y] by anything but a generic per-size helper also moves points without a y touch flag, where natural quality leaves them. This was the Arial 12 and 13 px
a,e,o,sresidual; a stem across an outer and an inner contour, with or without an x SHPIX first, is shifted exactly as the converter does (1,020 private captures,src/gdi-cleartype-contour.fixture.test.ts). Arial default-quality compat captures 403 to 408 of 420 exact, Tahoma 401 to 404;textx-arial-cleartypeand its q0/q1/q2 variants 217 to 193 differing pixels (parity log, R12-CT-default). - GDI ClearType scan conversion (round 12), read from
fontdrvhost.exe(EvaluateSpline,fsc_CalcSpline,fsc_CalcLine,LookForDropouts,DoHorizDropout,DoVertDropout,HorizCrossings,VertCrossings,CompDiv; the table at rva 0xa61c0) and checked by runningfsc_CalcSplineandfsc_CalcLineunder an emulator on random arcs and lines. The stage was isolated first with private program-free fonts whose glyphs are our own hinted outlines (gdi-cleartype-hinted.json.gz, 1,260 glyphs): hinting was not the cause of the curved-glyph differences. (1) Arcs. Each arc is cut at its y and x extremum (points byCompDiv, round half away from zero, control points level with the extremum) and, while it spans more than 3,200 units, at its middle with floored halves. Each monotonic piece is walked exactly but on rounded differences: with a = bits(2 (dy ax - dx ay)) and b = bits(max(dx, dy)) (dx, dy to the end, ax, ay to the control point, positive in the direction of travel) it drops s = 0 for a + b below 30, then 1, 1, 1, 2, 2, 2, 3, 3 bits from dx, dy, ax, ay and from the distance to the first pixel centre beyond the start on each axis, rounding half up, and the crossing of every pixel-centre line is where that rounded arc meets it (random arcs in all four directions: every row and column crossing equal; lines are exact). Below about 900 units of span nothing is dropped, which is why only the larger sizes differed. (2) Dropout control is decided from the recorded crossing pairs: a pair whose start and stop pixels are equal is a dropout between pixel centresstart - 1andstart; with stubs excluded (SCANTYPE 1 and 5) the unit square on each side of it must have at least 2 pair ends on its other three sides; it is skipped when pixelstart - 1orstartis already inked; otherwise it inks pixelstart - 1(simple modes) or the pixel holding the middle of the two crossings, each floored to 1/64 (smart modes). Rows run from the top down, then columns from the left. (3) GDI ClearType gives a font that never runs SCANCTRL the simple mode 0 (256 random polygons 340 to 16 differing pixels; GDI+ keeps none). Results: natural-quality compat captures (420 per face) exact Arial 411 to 420, Segoe UI 396 to 419, Tahoma 406 to 415; hinted-outline fonts 1,255 of 1,260;textx-segoeui-cleartype261 to 32 differing pixels,textx-arial-ctnatural200 to 73,textx-color-cleartype145 to 141. Left: the smart-dropout pixel of a few small Tahoma curves (e,@,$,sat 12 to 15 px; the native position routines behind[ctx + 0xc0]are not read), Segoe UI 12 pxA, and exact ties (a crossing exactly on a centre line, which native resolves by direction of travel). - Native glyph images are not a pure function of the font, size and hint. On the capture machine, the same probe with one OS build and one
gdiplus.dllreturned images that differ in 2,492 of 31,584 captures between a run at 06:21 UTC and the runs from 07:35 UTC on 8 October 2026, and a fresh capture of the committedtext-coverageset differs from the committed one (taken on 2 October) in 606 of 3,328 (text-native-states.json.gz,text-coverage-restate.json.gz; pinned insrc/gdi-native-state.fixture.test.ts). Repeating a probe within a run, or in back-to-back runs, gives identical bytes. The differences are one-sample moves of diagonal edges, and they track the projection arithmetic: in the later runs the per-product rounding that GDI's own outlines use reproduces about twice as many of the differing images as the converter's combined rounding, in the earlier ones neither does. A stateless converter cannot match all of them, so the references committed earlier remain the target. - A survey of the 166 other fixtures whose rendered extent is larger than their reference (
playback-extent-survey.json,src/gdi-playback-extent-survey.fixture.test.ts) found native playback ink bounds equal to the converter's in 162 and no ink beyond the reference except in the clipped text references, so the larger extents are blank margins. The fourcodec-jpeg-*-playbackcomparisons (12bit,arithmetic,arith-prog-420-dri2,cmyk-photo) were once measured against a 300 x 200 reference whose extra 9,600 pixels were the probe's own magenta surface; the metafile covers 280 x 180 (header bounds and frame agree), so the reference is now that extent and the whole surface is kept beside it as.surface.png(src/image-codec-native.test.ts). Expanded native captures cover 101 extents reproducibly (the sevencompat-playback-*sheets of round 6 included: Windows paints their ink at negative device coordinates exactly where the converter does, so their 420 x 300 captures were the clipped side). Nine other comparisons (eight old text recordings and the 25-degree rotated text) paint beyond their clipped reference PNG: native playback into a canvas of the converter's own size paints no ink outside it, so the output extents are right and the original references are the clipped side, and they are not promoted to references (their native captures are committed as*.wide.pngevidence). The nine were regenerated on this machine on 8 October 2026 (generate.ps1 ... -OutDir, manifestsenvironment-text-recorded-advance.jsonandenvironment-text-raster-regen.json). Seven reproduce their original PNG pixel for pixel as direct drawings (the five Arial sheets,textx-segoeui-cell-monoandrotate-text-25deg), so the originals are valid captures of this font environment; what differs is the recording. An EMF stores the advance array (dx) of every text record, and it holds the widths of the ANTIALIASED_QUALITY font whateverlfQualitythe font asked for (0 of 540 glyphs differ), while a direct drawing uses the widths of its own quality: 4 of 540 glyphs differ for default, draft, proof and ClearType (8 pxm,g,v,W; the 503 word-gap pixels), 105 for ClearType natural (39,661 pixels). Drawing directly with the recorded advances equals native playback exactly for all five Arial sheets, so a converter that replays the recorded dx, as this one does, matches Windows' playback and cannot match the direct drawing from the recording alone. The 989 Segoe UI pixels (36 and 56 px lines) are not an advance difference (Segoe's advances all agree) but a hinting one: every GM_COMPATIBLE EMR_EXTTEXTOUTW stores exScale and eyScale (hundredths of a millimetre per reference-device pixel: 23.3203125 and 23.33333 in the committed recordings, 15.546875 and 15.55556 on this 3840 x 2160 machine), and playback draws the text through the world transform diag(eyScale / exScale, 1), a horizontal stretch of 1.000558. Drawing the sheet glyph by glyph at the recorded advances under that transform equals native playback exactly (989 pixels direct, 0 stretched; and 0 differing pixels at all 57 Segoe UI cell heights 8 to 64,text-playback-hinting.json). The stretch is invisible to most fonts, but Segoe UI's grid-fitting reacts to it at nine of the 57 cell heights (24, 35, 36, 39, 40, 56, 58, 59, 64: stems a pixel wider, black-and-white and grayscale alike) and a height reacts once the stretch passes a height-specific threshold between 2.5e-5 (59) and 2e-3 (those above), so a larger stretch from another device would change other heights; the Em heights (negative lfHeight) of Segoe UI, and Arial, Tahoma, Times New Roman and Courier New at every cell height, do not react. The thresholds follow a rule found on the native outlines of 18 faces (StretchHintingProbe.cs,text-stretch-hinting.json.gz,src/gdi-text-stretch-hinting.fixture.test.ts): a reaction is a switch from the grid-fitted outline to the unhinted one at the same ppem, decided by the stretched x size rounded to 1/32 pixel,M = round(32 E (1 + s)), against the unstretchedM0 = round(32 E)(Eis the exact em size,h * unitsPerEm / (winAscent + winDescent)for a cell height and|h|for an em height): nothing changes whileM = M0, and the faces then split. Segoe UI (and, to 2%, 3% and 7%, Verdana, Comic Sans MS and Lucida Console) reacts once|M / 32 - P| >= 15/16,Pbeing the ppem the height is realised at: this predicts all 10,660 Segoe UI outcomes (cell and em heights, 65 each, 82 stretches from -0.4% to +0.4% and the playback ratio) and, for a stretch of 0.0558%, the nine heights above. Calibri, Candara, Corbel, Constantia and Consolas react wheneverMis not a multiple of 32 (every Calibri em height from 28 px at the playback ratio; exact for every enlarging stretch of the five bar one Consolas outcome below 8 px). Arial, Tahoma, Times New Roman, Courier New, Georgia, Trebuchet MS and Microsoft Sans Serif follow neither rule. The converter still draws the unstretched shapes: the reference PNGs are direct drawings, and applying the rule would trade the match oftextx-segoeui-cell-monoand of the 57-height sheet (174 pixels from the direct drawing, 4,220 from the playback) for the playback's 989-pixel difference to the committed reference, so the rule is pinned in the test only; the interpreter reproduces the unhinted outlines when told the glyph is stretched (HintEnvironment.reportStretched). The 23 pixels of the rotated text (rotate-text-25deg) are the same kind of difference as the Arial sheets, in the dx array: a rotated font's recorded advances are not the hinted widths a direct drawing uses ([14, 11, 6, 11, 6, 11, 11] for "Rotated" in Arial -20) but [14, 12, 5, 11, 6, 11, 11], and drawing with them equals native playback exactly at 10, 25 and 45 degrees in every quality (text-playback-hinting.json). The recorded array is the running position of the linearly scaled advances, each rounded to 1/16 pixel, rounded half up to whole pixels and differenced (rotated-text-advances.json.gz: 630 recordings of a 74-character line, five faces, 18 sizes, seven angles; 45,661 of 46,620 advances, and every advance at 5 and 25 degrees, are reproduced; the rest are positions exactly half a pixel, which Windows rounds up or down depending on the angle: always up at 5 and 25 degrees, down in 35 of 404 at 10, 53 of 403 at 45). The converter replays the recorded dx, so it places every glyph as playback does (the glyph origins are the same); its remaining 31 pixels against the playback (54 against the direct drawing the original PNG holds) were rotated glyph shapes, not placement, and are now 1 pixel against the playback and 24 against the original: GDI scales a rotated glyph by a matrix whose larger component is rounded to whole pixels (ppem * cosorppem * sin) with the whole rotation scaled by the rounded over the exact value, so the smaller component keeps the true angle (Arial at 20 px and 25 degrees: 0.900 and 0.419 where rounding both gave 0.900 and 0.400;roundedRotationMatrix, fitted on nativeGetGlyphOutlineof Arial at 12 to 48 px and 10 to 80 degrees and of Times New Roman and Segoe UI at 16 to 28 px,rotated-glyph-matrix.json.gz,src/gdi-rotated-glyph-matrix.fixture.test.ts; 2,539 of 5,436 native 1/64-pixel points reproduce exactly, 441 with the old rounding). The world-rotation text sheets improve (textx-world-mono283 to 262 pixels,textx-world-aa365 to 344); the escapement sheets are unchanged but for one pixel at 120 degrees (370 to 371). Tahoma's rotated outlines are not the unhinted ones (8 of 810 native points reproduce): it keeps part of its grid-fitting under rotation. A rotated run without dx still advances by per-glyph rounded linear widths here, which neither the recorded array nor a direct rotated drawing uses (a direct 25 degree drawing of "Rotated" is 62 pixels from drawing with the hinted widths and 36 from the recorded ones); no fixture exercises that.textx-fon-fixedsysandtextx-fon-systemdo not reproduce (28,896 and 16,138 pixels differ from the originals over the 480 px overlap; direct drawing and native playback agree with each other), and the cause is the installed raster set, not the mapper: this machine's session is at 144 dpi and Windows then serves System and Fixedsys from the 20 pixel 120 dpi faces8514sys.fonand8514fix.fon(the stock SYSTEM_FONT, SYSTEM_FIXED_FONT and OEM_FIXED_FONT report a 20 pixel cell here;raster-mapper.json), next to the 16 and 15 pixelvgasys.fonandvgafix.fonthe originals (a 96 dpi session) used alone, while every other raster face of the originals is reproduced exactly with the fixture set (GetTextMetrics at lfHeight -60 to 60 is identical for a DPI-aware process, which sees 144 logical dpi, and an unaware one, which sees 96, in this session, so the dpi a process is shown does not decide the set). The converter's mapper needs no change for this: given8514sys.fonand8514fix.fonit reproduces both regenerated captures exactly, direct and played back (0 of the 28,896 and 16,138 differing pixels remain,src/gdi-text-regeneration.fixture.test.ts), and it picks the native cell height at 118 of 120 System and 117 of 120 Fixedsys heights (src/gdi-raster-mapper.fixture.test.ts); given only the fixture font set it reproduces the originals (textx-fon-systemand, since the too-big stretch cost became 340 per pixel,textx-fon-fixedsystoo, whose 33 pixel line used to pick 30 instead of 45). A conversion therefore follows the fonts it is given: supply the host's8514sys.fonand8514fix.fonalong withvgasys.fonandvgafix.fonto get the sizes a 120 dpi or larger session draws. The regenerated captures are kept as*.regen.*. Raster faces are stretched by up to 8 vertically but at most 5 horizontally, as GDI does (a 16 pixel System face asked for 112 to 116 pixels is drawn 7 times as tall and 5 times as wide;raster-mapper-wide.json.gz): at lfHeight 61 to 130 the mapper picks the native cell height at 919 of 980 heights where it picked 631 when it stopped at 5, and the width at 929; lfHeight -60..60 is unchanged (822 of 840).
Wide pens and paths
All 2,136 paths in the native
WidenPathsweep (2–64 px pens, every cap and join) fill identically. The flattened-pen perpendicular follows a closed rule instead of a fitted table: the interpolated point of a pen edge, rounded to the half-pixel grid after a half-unit bias, with a further half unit when the edge's extent in that channel is odd. It matches nativeWidenPathfor every direction tested at integer, fractional and wider-than-100 px widths (about 390,000 whole-pixel directions at widths from 1 to 206 px, none differing), including vertical segments, exact ties and segments parallel to a pen edge.Wide pens on curves (Beziers, Arcs, Chords, Pies, AngleArcs and paths with curves) follow the pen at each flattened segment instead of treating the curve as a polyline: a pure Bezier matches native
WidenPathexactly under every cap and join in 80 captured cases (previously none). Arcs, chords and pies now match nativeWidenPathin all 240 captured outlines (previously 92;curve-widen.json, differing pixels 1,437 to 0; 239 of 240 before round 4): at one logical unit per device pixel (other scales cut it to whole logical units, as dashes do: a dashed pen under a world scale or anisotropic map mode lays its pattern out in logical units and measures each segment by its logical vector rounded to the nearest whole unit;scaled-dash-caps.json.gz: 1,416 native dashed square-capped arcs under six scales are all fill-identical, 95 before) a segment's square-cap extension is its vector cut down to whole pixels (components shifted right by four, the dash measure), a curve end uses its end tangent that way and a curve cut to one segment its chord, a line meeting a curve end takes the curve's tangent perpendicular, and the join inside one flattened cubic keeps its own pen vertices.arc-cap-sweep.json.gz(1,436 square-capped arcs swept over the end angle, two widths and start angles) is exact vertex for vertex. All 80 arcs, 80 pies and 80 chords are exact (round 4: the last chord, sample 206, was not the widener: the nativeGetPathof that chord widens exactly, and the arc geometry started a FIX off at a rounding tie, a start point at y = 3627.49993 FIX where native rounds up; 5,820 of 5,841 native widened near-complete chords fill identically from their own paths, the 21 others have a closing line under 8 FIX,chord-closing.json.gz). The arc points are now computed in single precision the way native does (float32 trigonometry nodes, float32 radius times unit coordinate): 900 of 900 native counter-clockwise arcs and 191 of 260 on the large circles are exact (898 and 182 before; 187 before the single-precision tangent lines of arcs up to 3 degrees,gdi-raster-arc.fixture.test.ts), and 168 of the 169 chords around sample 206 equal native (108 of them started a FIX off before). A chord whose arc flattens to a single segment is a closed polygon of two vertices that the closing line retraces: it takes joins at both vertices and no caps (before, it was widened as an open polyline with caps; all 1,044 native chords on arcs of 1 to 15 degrees, two widths, every cap and join, now fill identically,chord-sweep.json.gz, where 528 differed before). Flat-capped round joins match 5,998 of 5,999 native random three-point paths (previously 86 differed), and fractional pen widths 6.5–44 px match 2,997 of 3,000 random paths (previously 286 differed).Dashed wide curves follow
WidenPathexactly for round, flat and square caps (all 300 samples ofcurve-dash.json,gdi-raster-curve-dash.fixture.test.ts; round 4 closed the last square-capped sample, whose dash end sat on an exact-half rounding tie of the real over whole-pixel length scaling: GDI does that arithmetic in single precision, so the extension is a float32 product of the vector component and a float32 half-width over whole-pixel length, rounded half away from zero, and a dash cutx0 + d * t / lenis a float32 sum whose exact x.5 rounds up for a positive component and down for a negative one; 24 of the 1,300 neighbouring Beziers incurve-dash-neighbourhood.json.gzdiffered with double-precision arithmetic, one flat-capped dash still differs, by a pixel, and 36 of the 2,027 Beziers whose cut points sit within 6e-4 FIX of a rounding tie differ, by at most 6 pixels,gdi-raster-dash-cut-ties.fixture.test.ts) and flat caps are exact since a flat cap loops round the pen between the two inner sides of a flattened curve when that wedge holds two pen vertices or more and the join is not the boundary of two cubics (all but one of the 2,484 neighbouring dashed and solid arcs and Beziers fill identically; the one pixel at a sharp turn was a missing two-vertex wedge), where flat caps differed in 5 samples (24 pixels) before a dash that starts or ends on a flattened vertex kept a zero-length piece along the segment it was cut from (native joins it), and square caps in 2 (5 pixels) before cap lengths used the exact square root of the whole-pixel vector (Math.hypotput an exact rounding tie either side of x.5 depending on the JavaScript engine), and the whole-pixel dash measure is only known for one logical unit per device pixel without rotation (other scales measure each segment by its logical vector rounded to the nearest whole unit, above).Square caps and pen widths under a world scale, a rotation or an unequal-scale map mode (GM_ADVANCED; EMF playback never rounds device points to whole pixels, only WMF's whole-device-pixel replay does and it keeps the old rule): a geometric pen's nib is its device width in FIX, not a rounded width (the whole-pixel extent a pen shows on a horizontal or vertical line is the perpendicular's rounding: all 400 native pens, 1 to 40 logical units under ten world scales, are exact vertex for vertex on both a horizontal and a vertical line,
scaled-pen-widths.json; whole-pixel widths matched 367 of the vertical ones), while a square cap extends by half the unrounded width. The extension is the segment's device vector over its logical vector cut to the nearest whole logical unit per component, a tie away from zero (the device vector converted back to logical units, its magnitude plus half a unit floored, the sign kept; at the identity scale it is the plain floor of round 1): for 323 native vectors every vertex of the widened segment is identical under each of eleven transforms (identity, scales 0.5, 0.6, 0.7, 0.75, 1.3, 1.5, 2 and 2.5, and the 10:7 and 4:3 map modes; before, 260, 224, 158 and 268 of 323 at 0.7, 1.3, 2.5 and 10:7, where the pen is not a whole number of pixels) and the cap positions under a 30 degree rotation (259 before), and swept arcs match vertex for vertex in 358 of 358 under scales 2, 0.5, 0.75 and 1.5 (344, 315, 324 and 329 before the tie rule, 2, 170, 135 and 53 before the cut) and in 356 and 358 of 358 under 1:2 and 1:16 anisotropic maps (321 and 353 before;scaled-line-caps.json.gz,scaled-cap-sweep.json.gz). The two 1:2 arcs that ended in a one-FIX final segment (31 and 32 pixels off) are exact now: their last Bezier runs past its end point and returns, and native turns the join at the last vertex along the end tangent, which opposes the last flattened segment (a round wedge on the leading side;curve-end-reversal.json.gz: 1,440 native outlines of 240 such Beziers under three caps and two maps, 304 differed before and none now,src/gdi-raster-curve-end-reversal.fixture.test.ts). Rotated arcs were off in their pen nib (first cap midpoint 92 of 358) before round 6; the nib is exact now and all 358 swept arcs and all 323 segments under the 30 degree rotation are vertex for vertex native (94 of 358 arcs with the exact vector; two arcs end the extension on a tie, -81.5 and -82.5 FIX, which native rounds away from zero once the vector is cut to whole units;scaled-cap-sweep.json.gz), a GM_COMPATIBLE application's own device points (rounded to whole pixels,c3:4: 117 of 323 vectors) are not modelled for EMF because playback does not round them; dashed pens under a scale follow the logical-unit measure above (gdi-raster-scaled-dash-caps.fixture.test.ts).A RoundRect record plays back the same whatever graphics mode its application used: an EMF holds no graphics-mode record (neither
SetGraphicsModecall is recorded, and the files recorded underGM_COMPATIBLEandGM_ADVANCEDdiffer only in theEMR_ROUNDRECTbox, which the compatible recording stores one pixel short at the right and bottom), andPlayEnhMetaFilebuilds the same path from either record: for 800 native RoundRects (100 per pen kind and mode, both arc directions,emf-roundrect-mode-paths.json.gz) the converter's path equals the playbackGetPathin all 800, and the six sheetsemf-roundrect-mode-{compat,adv}-{null,cosmetic,wide}are pixel-exact in both modes (49 pixels under a null pen and about 210 under a wide pen differed before). A cosmetic, wide or geometric pen keeps the corner ellipse unscaled on the record's box; a null pen's box grows by a quarter pixel on every side and the corner ellipse is scaled onto the grown box, truncating to whole FIX (also in a path), and under any map mode the same quarter-pixel growth applies to a null pen's Ellipse, RoundRect, Chord and Pie exactly when all four device edges are whole pixels (compat-ellipses-*: 315 null-pen Ellipses at every fractional phase of ten maps and world scales, 0 differing pixels from 3,185 and 1,925 at the 1:2 maps; none of the boxes with a fractional edge grows, which the earlier identity-scale-only rule had measured from direct calls). The scaling aGM_COMPATIBLEapplication sees when it draws the call straight onto a device (the corner scaled onto the drawn box,emf-roundrect-wide-paths.json.gz) is not part of the playback and is no longer applied:emfrec-path-widen, whose reference PNG was drawn directly, now uses the native playback of its metafile as the reference (emfrec-path-widen.direct.pngkeeps the old one, 16 pixels at the RoundRect corners different).EMR_WIDENPATHellipse outlines now match native vertices for every cap/join combination in the 2–32 px sweep, including the duplicated inner triangles. The stroked-outline fixture matches exactly; mixed cap/join polyline and curve cases retain small residuals.EMF+ 1-pixel antialiased lines can differ by one antialiasing sample at their ends, and some closed widened outlines by one sample along an edge.
PS_INSIDEFRAMEpens in EMF playback now pull a Rectangle, RoundRect, Ellipse, Arc, Chord or Pie box in by the pen width along each axis, as nativeGetPathshows (the 16-widthemf-insideframe-*sheets of every shape are pixel-exact at the identity scale; before, an EMF inside-frame pen was stroked centred on the outline, 16% to 35% of the pixels off). Under a fractional world scaleemf-insideframe-scaledis pixel-exact. Solid wide pens under axis-aligned unequal scales now use an elliptical nib, including its square-cap metric and miter limits: all 216 controls across eight native image sheets are exact, and all 3,600 native widened outlines and 16,128 independent direction/corner controls are exact. Elliptical pens resolve parallel-edge ties using the logical 45-degree boundary. Dashed pens under axis-aligned unequal scales lay their pattern out in logical space along the same elliptical nib: all 2,160 native dashed outlines (stock and user styles, every cap, three directions) are exact. Rotated or sheared matrices (round joins) widen with the matrix's own nib: the ellipse of a box centred on the pen whose half edges are the images of the logical half width, rounded to a quarter FIX, flattened (round 6; before, GDI's logical circle mapped through the matrix, rounded and flattened;nib-matrix-pen.json.gzandrotated-pen-nibs.json.gzcapture the native nibs): all 216 pure-shear and shear-with-scale outlines ingeneral-matrix-pen.json.gzare exact, and the rotated ones kept about 2,500 differing pixels over 288 outlines until round 6, which closed them (the half-pixel rounding of a diagonal segment's perpendicular was the nib's construction, now an Ellipse box of the half-width images with a quarter-FIX rounding bias: all 504 outlines of the seven non-trivial matrices ofgeneral-matrix-pen.json.gz, 6,432 of 6,432 flat-cap corners and 864 of 864 native nibs are exact; see Outstanding work, "Round 6: the rotated GDI pen"; before that, round 4: a rotation with a uniform scale uses the digital pens of 1 to 6 pixels unrotated, as native does for a device circle that narrow, and dashes measure each segment by its logical vector rounded to the nearest whole unit, as under a scale, which together took the 30 and 45 degree matrices from 1,087 and 424 to 620 and 292 differing pixels). Miter and bevel joins under such a matrix are widened in device space with the same nib (see the bullet below). A pure scale without rotation and the GM_COMPATIBLE path keep the uniform device-space pen; transformed curves need independent coverage. EMF+ Inset-aligned and compound-array (CompoundArray) pens are GDI+ features: the converter widens them with its GDI+ widener (exact on the probedgpx-pen-stylespens) and with Canvas strokes only undergdiAntialias: true; the native captures of inset and compound pens on closed figures are described under EMF+ (GDI+ refuses the inset and compound combination, so that one has no capture).A bevel or miter join under a rotated, sheared or mixed world transform is widened in device space with the matrix's nib, as a round join was: all 288 native outlines exact after round 6 (221 with 2,055 differing pixels before it; 42 when widened in logical space and mapped forward): the miter limit is tested on the tip's offset in logical units, rounded to whole units (3,360 more native corners under rotations and mirrors,
rotated-pen-miters.json.gz, all pixel-identical; 140 of their outlines repeat one inner vertex in native, a zero-area spike).
GM_COMPATIBLE recordings
EMF files do not record the graphics mode, and Windows plays RoundRect records back identically whichever mode wrote them (see Wide pens and paths). Windows plays back Arc, Chord, Pie and null-pen Ellipse records differently from how a GM_COMPATIBLE application drew them on screen. The converter follows Windows playback; the playback re-measurement (compat-playback-*, 42 sheets of mixed shapes recorded under six map modes and seven pens, compat-rects-* and compat-ellipses-*, 60 sweep sheets) also found that a Rectangle drawn with a cosmetic or dotted one-pixel pen puts the outline and the fill on ceil(device coordinate) at every edge under any non-integral map mode or world scale (10,744 pixels differed on the 4:3 sheet before, 0 now), and found that Windows measures the radials of Arc, Chord and Pie records in logical space, as the fraction of the record's box they sit at (the radials, rounded to FIX before, left 0 to 55 pixels per sheet; the 3,600 native playback paths of compat-playback-paths.json.gz are exact now and the sheets' arcs are pixel-exact, all 42 sheets are pixel-exact since the RoundRect corner became the half box times the call's corner over box ratio; see Outstanding work). Maps that mirror an axis (a negative viewport extent) are reproduced too: the record stores a box in device order and the recorder inverts the arc direction once, a shape is Windows' logical one mapped point by point with the roundings of the mirrored axes flipped, and a Rectangle's cosmetic edges are ceil(device coordinate) in any orientation (132 mirrored sheets, 550,437 differing pixels before and 55 now; Arc, Chord, Pie, Ellipse and Rectangle paths are exact; a wide pen on the anisotropic 3:2 map that mirrors x takes the matrix nib (penPolygonMatrix) instead of the flattened ellipse, 169 and 166 differing pixels on the plain 3 unit sheets before and 2 now, and 28 further native sheets of lines, triangles, ellipses and dots under 3 and 4 unit pens pin it (25 exact, 5 differing pixels over the other three; a dot on a whole device pixel has its nib pulled in by one FIX, 5,653 native outlines, src/gdi-dot-nib.fixture.test.ts); left: the RoundRect corners under the non-dyadic maps and an inside-frame RoundRect under a mirrored x, which is not mirrored).
EMF+
Page units convert at the
EmfPlusHeaderLogicalDpiX and LogicalDpiY (UInt32, per axis), not a fixed 96 DPI, so a file recorded at 72 DPI and drawn in points fills its header bounds as GDI+ draws it. Display is a pixel, or 1/100 inch when the header's EmfPlusFlags mark a printer reference device, and it is the unit playback and every container start in. GDI+ ignores anEmfPlusSetPageTransformwith the World unit, an unknown unit or a scale that is not positive. ABeginContainersource rectangle converts at the header DPI too, with World as 1/100 inch. The page transform carries acrossEMR_COMMENTrecords. Measured with synthetic files against GDI+ playback (parity log).Pen and font units follow GDI+ playback. A Pixel pen is that many device pixels, with a round nib, whatever the world and page transforms. Display and unknown pen units act as World. GDI+ rejects a pen in Point, Inch, Document or Millimeter units: it draws nothing, and it still replaces the pen in its object slot. A World, Pixel, Display or unknown font em size is in page units. A Point, Inch, Document or Millimeter em size converts at the header DPI and only the world transform scales it, so fonts in those units now take the exact font-engine path too.
Plain Bilinear image sampling and texture brushes use measured 1/2048 fractional weights, byte-rounded premultiplied colours and GDI+'s coordinate stepping. All 144 rectangular image controls and all 240 texture controls match native premultiplied RGBA, including alpha. The stepping was isolated in round 7 with native sweeps of the brush translation or image origin by a power of two per draw over a 2 x 2 texture or stripe image whose filtered colour flips where the quantised coordinate crosses a half texel (
texture-coordinate.json.gz,image-coordinate.json.gz; each pixel's flip draw is its native coordinate, with no model fitted): the inverse matrix is float32 with every operation rounded toward minus infinity (4,000 of 4,000 nativeMatrix.Invertresults,matrix-invert.json.gz), a row's first position is formed from it the same way, and each further pixel adds the x step in float32 rounded down, so the position drifts below the exact one by up to a float32 unit per pixel (3 bins of 1/2048 by pixel 156 of a 0.45x reduction, 8 bins by texel 560). That was the residual the per-pixel model left: 34,903 of 61,916 recorded flips are missed from the double-precision inverse, 1,959 with the stepper. The recorded texture fixtures fall from 115 to 318 differing pixels to 0 to 2 (tile, flipx, flipy and nearest-tile 1, pom-half-tile 2, flipxy, hqbicubic-flipxy and clamp 0) and the plain Bilinear image fixtures from 18 (bilinear, default, low), 3 (each attr-*-bilinear) and 4 (rotated) to 0. Left in round 7: the last bit of the first position for starts below zero and under PixelOffsetMode Half (the sweeps that start there missed 40 to 616 flips of 3,472 to 5,120, each one draw early or late; exact since round 11, below), and the six one-level pixels of the independent cropped/mirrored image controls. The one-level pixels of the three JPEG playbacks (22, 2 and 7) are not partial-alpha edge pixels (round 8): they sit on the columns and the row whose 1/2048 fraction falls 0.006 to 0.014 bin below a rounding boundary (columns 57, 66, 158, 176, 185, 194 and row 147 of the 260 x 170 draw), where native lands on the other side; accumulating the x step in float32 rounded to nearest instead of down reproduces those columns exactly (22 to 10, 2 to 1, 7 to 4 with no new column) but breaks the plain Bilinear fixtures (2 to 5 pixels) and theimage-coordinatesweeps, so the round-down stepper stays. Round 10 bisected the brush translation over consecutive float32 values (texture-bisect-*.json.gz, 115 matrices, 6,238 flips,emf-plus-texture-bisect.fixture.test.ts) and found the stepper exact when the fill starts at pixel 7 or later (every flip of the 0.3 scale at starts 7 to 16) and wrong below it (at most 2 of 120 at starts 0 to 5), with a step a few float32 units below the inverse's entry (1 to 3, a different amount per matrix) and the translation on a 2^-19 grid; no formula tried reproduced it in round 10. Round 11 readDpOutputBilinearSpan::OutputSpanin gdiplus.dll and closed the texture brush: native does not step by the matrix's x entry, it transforms the two end pixels of each span (a scanline of the fill, or one run of covered pixels) through the float32 inverse, divides the difference by the span's pixel count and adds that step to the start once per pixel, every operation a float32 one rounded toward minus infinity, andPixelOffsetModeHalf is part of the matrix before it is inverted (T(0.5) m T(-0.5)). That reproduces all 6,238 bisection flips and all 61,916 flips of the 16 coordinate sweeps (the Half ones included), and the five 1 to 2 pixel texture fixtures (gpx-texture-tile,-nearest-tile,-flipx,-flipy,-pom-half-tile) are exact. The 16 JPEG playback pixels (12, 3 and 1, the draw stage: the decoders are exact) and the 6 rotated-blur pixels in each of the two blur fixtures are theDrawImagepath, which keeps its own stepper and stays at one level in one channel each (blur (98, 83): three channels). See the 12 October 2026 review for the earlier measurements and open-source options.A translucent
ImageAttributesclamp colour is read as literal premultiplied bytes, as GDI+ does:Color.FromArgb(160, 217, 43, 129)is the premultiplied pixel (217, 43, 129, 160), a red above its alpha, so a blended edge pixel can hold a channel greater than alpha (red 179 with alpha 147). Against 24 native draws per interpolation mode (alpha 40, 160 and 255, scales 1 and 2.5;translucent-clamp-surfaces.json.gz) plain Bilinear, plain Bicubic and HighQualityBilinear now match native premultiplied output on every pixel (64, 131 and 131 differing pixels before) and HighQualityBicubic goes from 160 to 35 differing pixels. A channel above its alpha is saturated, since a canvas stores premultiplied bytes of at most the alpha. A premultiplied intermediate does not remove that: native composites SourceOver onto a premultiplied surface as one 32-bit add of the pixel and the backdrop times (255 - alpha) / 255, carries included (6,578 of 6,578 touched pixels), so an excess channel carries into the next one (blue into green into red into alpha) and a red excess wraps the alpha to 0 with colour, which a canvas cannot hold and which would need a readback compositor for those edge pixels. Opaque clamp colours and the 24 alpha/compositing controls were already exact.Rotated and sheared
HighQualityBicubic/HighQualityBilinearDrawImageis drawn the way GDI+ draws it: the source is first scaled axis-aligned to the whole number of device pixels each destination edge spans (rounded up), then that 8-bit bitmap is drawn with the plain Bicubic or Bilinear kernel (an edge within one pixel of the source length skips the first step). The fixturegpx-image-rotated-highqualitybicubicis within one channel level on every pixel (5 of 16,000 differ by one level at zero tolerance, before round 10: 10 of 15,741, and in round 3: 2,911 pixels, up to 10 levels; all five sample the intermediate at an exactly whole position of the 1/64 phase, where the converter's 16.16 row stepper lands one unit of 1/65536 texel below and native on or above: a start one unit later closes the five but loses 37 exact captures ofhq-rotated, so it is not applied, see parity-log.md "Round 10 (R10-F2)"), and 600 native rotated captures (angles 10 to 60 degrees, scales 1.1 to 3, impulse, noise and alpha noise, PixelOffsetMode None and Half) stay within one level except the cubic's rare two to five (src/emf-plus-high-quality-rotated.fixture.test.tspins the counts). Axis-aligned high-quality draws use GDI+'s fixed-point arithmetic: the cubic weights are the measured native integer table (exact on 1.2 million designed values and on all 46,569 upscaled noise values, both kernels), reductions put each texel edge in destination space in 16.16 fixed point, floored to 1/128 pixel (round 8: edge distance in 1/65536 texel times a multiplier,round(2^32 / step)for the tent and the even2 round(s 32768)for the cubic, with the step rounded up from a reciprocal fraction of 0.47; exact on 146 of 148hq-reduction-griddraws, up from 73, and on all 4,536 bicubic and all but one bilinear noise value from 0.9x to 0.25x), a mirrored axis steps backwards from the far end (mirrored 2.25x upscales are exact), and a fractional left edge steps from its unsnapped position (an edge within 1/32 pixel of a whole pixel still leaves that pixel out, horizontally it steps from the whole pixel); all 288 arithmetic captures are exact (206 before) and 172 of 192 independent ones (38 before round 4, 122 before round 5), and the six HighQuality image fixtures are within one level with no pixel beyond it (round 8, pixels differing at zero tolerance:gpx-image-highqualitybicubicand-high121 to 12,-highqualitybilinear34 to 7,-pom-half-,-pom-highquality-and-pom-highspeed-highqualitybicubic28, 28 and 49 to 0,gpx-image-attr-clamp/flipxy/tile-highqualitybicubic97, 77 and 120 to 67, 41 and 90, then in round 10 to 0, 0 and 0: all 90 were the last row of the cropped third draw, whose kernel row past the vertical margin wraps inside the margin-extended rectangle, see parity-log.md; the 12 and 7 left were the first two columns of the 58 x 20 reduction, closed in round 10: a reduction whose destination edge is beyond 64 pixels starts one unit of 1/65536 texel early (two units beyond 256, up to 512; a vertical axis starts the same number later), the size of a float32 step of the edge in 16.16, sogpx-image-highqualitybicubicand-highare exact and-highqualitybilinearhas one pixel left,hq-reduction-positions, 929 of 936 draws with an edge up to 512 exact; past 512 pixels the start reads 4 to 5 units and is not modelled) (src/emf-plus-hq-cubic-weights.fixture.test.ts,emf-plus-hq-phases.fixture.test.ts). A scaled draw's vertical pass reads the source rectangle's rows plus the kernel's radius in texels (rounded up) and drops every tap past that, so the last row of a cropped draw fades (alpha 251 for a 3x tent draw); a mirrored unit-scale axis is an exact mirror for aDrawImagedestination rectangle (a negative width) and, forDrawImagePoints, only when the source rectangle's width and height are both powers of two, otherwise an image translated two texels (the converter tells the two records apart,src/emf-plus-hq-crop.fixture.test.ts). An ImageAttributes WrapMode wraps the overhang through the same weights (axis-aligned draws are exact in every mode; Clamp to a transparent colour is no wrap), a rotated wrapped draw is the two-stage draw with the wrap applied to both stages, and a rotated draw snaps only its first destination corner to 1/16 pixel (emf-plus-hq-wrap.fixture.test.ts). Still open: a reciprocal step within 0.004 below a half rounds either way depending on the draw's height (round 7: GDI+ keeps the scale as a float32 and inverts the float32 matrix with float32 arithmetic, determinant and reciprocal included, so the last bit of each axis' scale decides the side of the half and the vertical step depends on the width; the nearest-rounded scales giveround(65536 fl(d r))andround(65536 fl(a r))withr = fl(1 / fl(a d)), and the extent of the quad uses the scale rounded toward minus infinity. That reproduces 572 of the 680 draws of the 1.37x and 1.55x grid, 438 before,src/emf-plus-hq-step-grid.fixture.test.ts; the 108 left are tall sources of one to four rows and the 8, 16 and 32 wide sources of height 64 at 1.37x, and none of 243 roundings of the chain predicts them), positions are a few units of 1/65536 off for wide sources and non-power-of-two steps, the margin of a cropped unit-scale vertical axis (whether the tap one texel past the rectangle is read is a float32 coin toss that depends on the destination's offset, the height and, for points, the width), a unit of the mirrored position of roundedDrawImagePointsdraws, the far-edge ring of rotated wrapped draws, one rotated Half draw at 45 degrees and 0.5x, and a few values at kernel-end ties in reductions (docs/parity-log.md, Round 4). The unrotated Bicubic PNG fixture now matches every RGB pixel, and 144 independent arithmetic captures are exact including alpha. Near-integer unit-scale copy eligibility is confirmed over a phase interval of 1/64 either side of a whole texel, closed at the negative end and, at the positive end, only for rectangles whose width and height are powers of two (and, past 256 texels ofw * h * max(w, h), only when the other axis' offset is a multiple of 1/128): all 384 phase controls and all 936 independent copy captures (866 before round 4, 930 after) are exact, and a native sweep of 11,058 boundary draws and 10,368 size draws agrees (src/emf-plus-bicubic-arithmetic.fixture.test.ts). High-quality draws scaled in only one axis now filter both axes; 480 arithmetic/crop/mirror/alpha controls tighten without per-case regressions. Sub-rectangle sources at whole-bin steps retain larger zero-tolerance sampling differences. A directly requested rotated or sheared plain Bicubic draw (round 7) runs the integer pipeline of the axis-aligned one with a float32 position stepper rounded toward minus infinity and the destination parallelogram covered by the aliased fill rule from its unsnapped corners, as NearestNeighbor is: the 64 independent shear and rotation captures go from 10,296 differing pixels (up to 255 levels) to 44 (at most 5 levels), andplus-effect-blur-r3-rotate30from 11 pixels up to 169 levels to 6 pixels of one level. The high-quality kernels' horizontal pass is not a float32 stepper: native level sequences under a swept origin (image-levels.json.gz) agree with the integerk S + offsetpositions for 46% to 69% of the changes within one draw and replacing it with a float32 round-down stepper drifts by up to 12 draws (2^-16 pixel) by pixel 40; the vertical sequences dither by a level between neighbouring bins where the model is monotone. SVG defaults to renderer scaling;imageResampling: 'exact'uses device-resolution GDI+ resampling.Round 12 read
DpOutputBicubicImageSpan,DpOutputSpanStretch<0>(tent) and<1>(cubic),DpDriver::DrawImage,GpGraphics::DrvDrawImageandGpGraphics::DrawImagein gdiplus.dll and ported what they run (gdiplus-span-stretch.ts,gdiplus-image-points.ts; every float32 operation rounded toward minus infinity). The plain Bicubic span starts atfloor(u0 65536 + 1/2)and steps byfloor((u1 - u0) 65536 / n + 1/2)in 32-bit integers from the float32 end pixels of each covered run, the kernel phase being bits 10 to 15, so a rotated or sheared Bicubic draw is no float stepper. A rotated high-quality draw isDrvDrawImage: the three points go to device space in float32, each of the first two edges isceil(sqrtf(dx^2 + dy^2))(an intermediate size of that many pixels, or no intermediate when either edge is within 1.0000001 of the source length), the source is drawn into a premultiplied bitmap of that size with the same mode (CompositingMode SourceCopy), and the bitmap is drawn to the same three points as an ordinary points draw, whose plain kernel then runs the float32 matrix chain of the points form (the matrix inferred from the points, the corners sent through it, the driver's matrix inferred again and multiplied by the world matrix, inverted, the span as above). That settles the 5 pixels ofgpx-image-rotated-highqualitybicubic(the rotated plain pass sampled exactly whole 1/64 phases) and the 6 of each rotated-blur fixture, which is a points-form plain Bilinear draw that earlier rounds had kept on the per-pixel model for rotated quads: 0 differing pixels in all three, and across the 600 nativehq-rotatedcaptures no group gets worse and most improve (for example k7 PixelOffsetMode Half 1.1x impulse 45 pixels to 12, k6 None 1.25x to 3x noise 33 to 19; PixelOffsetMode Half is the same chain with the world matrix moved half a pixel). An axis-aligned HighQuality draw is the stretch span:InitializeClassforms in float32 the source stepS = floor(s / d 65536 + 1/2)and its reciprocal, the first position from the 1/16-snapped floor of the left edge ((dx - floor(edge)) Sfrom the right edge when mirrored), the kernel stretchfloor(K s / d 65536 + 1/2)held at least 1 for the tent and 2 for the cubic (K1 and 2) and the weight-table stepfloor(65536^2 / stretch + 1/2); a pixel's weights are differences of the kernel's running integral at((texel << 16) - position) R >> 16stepped byRper texel (index>> 9into the tent's512 j - 2 j^2table,>> 8into the cubic's, which is the measured half-grid table ofhq-cubic-weightsas a running integral: the binary's 1,024-entry table equals it on every entry, and the tent's table equals512 j - 2 j^2on all 513), the horizontal result is an 8-bit premultiplied row and the vertical pass weighs those rows the same way. The "float32 coin toss", the reciprocal step "within 0.004 below a half", the start shifts by edge magnitude and the cubic's weight rows are all consequences of those float32 operations, not separate rules. Against the native captures the port is exact on all 46,569 upscaled and 4,536 reduced noise values of both kernels (the fitted model had one bilinear value off), on 144 of the 148 draws ofhq-reduction-grid(the four left are coverage of a left or top edge a hair above a whole pixel, which the test does not model) including the two 64 x 48 to 58 x 20 fixture draws, with the 21 and 29 pixel reductions whose reciprocal sits at 124,830.48 and 90,394.48 stepping up, because the destination rectangle the span gets is the float32 chain of the rectangle form (GpGraphics::DrawImagebuilds the source-to-destination scale with the translation anchored at the right and bottom edges, the corners go through it, the driver infers its matrix) anddhordwsits a float32 unit under the number drawn. The 1.37x and 1.55x step grid was not re-run.gpx-image-highqualitybilinearis exact (1 pixel before). Used for whole-bitmap sources without attributes, PixelOffsetMode None, unmirrored; cropped sources (native stretches the source rectangle plus a margin), wraps, Half offsets and mirrors keep the fitted path. Recorded points are read as the points GDI+ gave its driver (the recorder logs them after the rectangle has gone through its matrix), which reproduces the directly drawn fixtures; a real playback goes through the matrix inference once more (DrawImagePointsEPR::Play), and against 60 freshly recorded and natively played-back rectangle draws (HighQualityBilinear, 64 x 48 noise) that extra pass is exact on 56 and the other four differ in one row or column only. The two readings differ by 26 pixels on the 98, 4, 58, 20 draw recorded here, while the fixture's own playback equals the direct draw; giving the world matrix an x scale of 1.0000001 (one float32 unit) makes the second reading reproduce the fixtures, so their playback matrix is not exactly the identity (the header's device size is 2560 x 1440 where the recordings made here have 3840 x 2160); that matrix was not derived. Open: that playback matrix, the stretch's source margin for cropped sources and the fill coverage of edges a hair above a whole pixel.Round 11 replaced the fitted path-gradient models of the next bullets with the converters of the system gdiplus.dll, ported in single precision rounded toward minus infinity (the rounding GDI+ runs with): per-vertex surrounds are Gouraud-shaded fan triangles with the library's integer edge walker (exact on all 174,084 painted pixels of 333 captures, with Blend and InterpolationColors curves on 23 more), uniform surrounds are a table of
ceil(|d1| + |d2|) + 2colours read through one bilinear quad per boundary edge (plus a constant inner quad under a focus), so the "nested copies", their tie rules and the strip solver no longer exist in the code. Open: 24 colour controls of tiled ellipses on fractional bounds (346 to 3,470 pixels each, at most two levels: the boundary of the tile bitmap is flattened after the bitmap transform in native) and the span window of non-rectangular fills (2 pixels of a star).Path gradients now step the way GDI+ draws them, as nested copies of the boundary (superseded by the bullet above): the centre-to-boundary ratio rounds to one of
ceil(2 * hypot(w, h))steps for the device-space bounding box (a 2x world or brush scale doubles the count, 0.5 halves it), the colour of a step is a float32 ramp accumulated from the centre colour (the step 1 / N and the running sum rounded toward minus infinity, which also makes a half-level tie fall toward the centre colour; all 984,120 pixels of the 12 large captures and all 25,568 pixels of the step rows are exact), premultiplied channels and alpha interpolate together, and a Blend or InterpolationColors curve is read at the step. Native rows through 72 white-to-black rectangles (4 to 2,000 pixels wide) are reproduced to 25,390 of 25,568 pixels, and 64 images of rectangles, triangles and ellipses (plain, world scale 2 and 0.5, brush scale 2, isotropic focus, Blend, preset) to 99.25-100% exact with no pixel beyond one level. Earlier captures rise from 497,349 to at least 596,053 exact pixels of 640,000 (opaque colours), 197,700 to at least 218,385 of 320,000 (translucent colours), 282,949 to at least 319,858 of 320,000 (uniform alpha) and 269,712 to at least 287,982 of 288,000 (isotropic focus contours), the lower bounds pinned insrc/emf-plus-path-gradient-steps.fixture.test.tsafter the later copy and tie rules (595,655, 217,832 and 318,577 with the step count alone). Playback of a rectangle with a Blend curve (all five WrapModes) and of the 50/50 focus rectangle, ellipse and triangle is pixel-exact in PNG and embedded SVG; the Clamp ellipse keeps 14 differing pixels (from 881; none after the nested-copy rasterisation below), the tiled ellipses about 140 (from about 8,300; 12-16 after) and a pen stroked with a path-gradient brush 48 (from 1,807; 2 after). Stepped later and reproduced in the bullets below: tiles cut from a bounding box on fractional pixels, independent focus scales and surround colours that differ per vertex. A ratio exactly half way between two steps was first left at the unquantised value (the same geometry traversed in the opposite vertex order flips about half of them); the rule for the pixels on a copy's edge is in the bullets below, and the pixels it does not cover still keep that value.Rotated, sheared and anisotropically scaled uniform path gradients now take their step count from the untransformed bounds and the matrix's linear part (
ceil(|M(w, h)| + |M(w, -h)|), the sum of the two device diagonals of the bounds) instead of the device bounding box of the transformed shape: a 60 x 40 rectangle has 145 steps at any rotation (194 at 30 degrees before), 189 under a 1.5 x 0.7 scale and 153 under a unit shear. 70 native captures (world and brush transforms of a rectangle, a triangle and a wide rectangle) rise from 61% to 90% exact over the first 48 of them with the step count alone, and to 156,221 of 156,236 painted pixels with the copy rasterisation below.Tile bitmaps of curved path gradients (round 12): the outline is flattened under the bitmap's matrix from the path as recorded and the scale comes from the path's own extent, the texels are premultiplied, filtered and divided by the alpha as bytes, and a fill with a coverage mask gives the converters the run of covered pixels of each row as the window (the star's 2 pixels). The five tiled ellipses are 78,402 exact of 78,494 (were 58,985), and the 120 colour controls 113 differing pixels (were 35,260). Mechanism and measurements: parity-log, "Round 12: tiled ellipses and span windows".
A tiled path gradient whose bounding box is not on whole pixels is reproduced the way GDI+ draws it: the gradient, with its steps, is rendered into a bitmap of
round(right) - round(left)byround(bottom) - round(top)pixels with the shape scaled into it, and that bitmap is drawn from the real bounds' corner, scaled by real bounds over bitmap, with a bilinear filter (weights to 1/2048; the mirrored modes reflect at the texel edge). 1,535,770 of 1,536,000 pixels of 80 native rectangle tiles at fractional origins and sizes are exact (772,603 with the smooth ratio used before) and none is more than a level off; five tiled ellipses rise from 36,555 to 58,985 exact pixels of 78,494 and from 4,064 to 140 unpainted. Rotated or sheared tiles and tiles with per-vertex surround colours keep the smooth ratio, and the pixel on a tiled ellipse's leftmost and rightmost point (and a triangle's apex), which native leaves unpainted, is still painted.The nested copies of a uniform path gradient are rasterised the way GDI+ does it: the boundary and centre are rounded to the nearest 1/16 pixel in device space and each copy is the exact scale of those points about the centre, a step's colour rounds a value exactly half way between two levels toward the centre colour, and independent horizontal and vertical FocusScales scale the copies per axis. Fractional-geometry captures (a rectangle and a triangle at 46 rotations, scales and shears) are 100.00% exact (107,809 of 107,809 pixels), alpha controls' differing pixels fall from 255,177 to 1,389, the anisotropic focus contours rise from 1,594,271 to 1,725,250 exact pixels of 1,728,000, rectangles with scales 75/25, 25/75, 50/0 and 0/50 are pixel-exact,
grad-path-ellipse-clampgoes from 14 differing pixels to none, the tiled ellipses from about 140 to 12-16, a pen stroked with a path gradient from 48 to 2 and the text gradient from 1.65% to 0.98% (6.53% to 6.27% without the font engine). A pixel exactly on a copy's edge (a copy at half scale of an integer-sized shape) follows a measured rule for axis-aligned and 45 degree edges: native holds the ratio in binary fixed point, so a pixel that reads the exact coordinate of its edge (an x-major pixel on a vertical edge, a y-major one on a horizontal edge) is outside the copy when the tie ratio is a binary fraction and inside when it is not (none of 38,872 ties of the single-edge sweeps differs), and a pixel along the other axis of an edge directed right or straight down is inside before the centre's foot unless its position along the edge is a binary fraction, outside after it. 400 rectangles from 2 x 2 to 40 x 40 (path-gradient-edges.json.gz) rise from 164,684 to 176,222 exact pixels of 176,400 clockwise, 158,192 to 176,008 with the centre on a pixel centre, 164,684 to 176,222 counter-clockwise (the rule mirrors with the winding); the 14 rectangles and 7 diamonds ofpath-gradient-ties.json.gzrise from 46,082 to 46,861 of 46,868 and from 14,804 to 15,050 of 15,056; 14 of the 360 colour and alpha controls tighten. Without a focus that rule was replaced by the float32 evaluation of the next bullet; with a focus the other pixels of a slanted edge and about a tenth of the along-the-edge pixels of an edge directed up or left still keep the half-way colour of the two steps (or a wrong side), within a level or two of either answer. The same rules reproduce the pixels on the edges of copies with an isotropic focus and of copies with independent FocusScales (each copy is the boundary scaled per axis about the centre point; the 20 rectangle captures ofpath-gradient-focus-shapes.json.gzare now pixel-exact, 99,930 of 100,000 before, and the 252 focus contours rise from 2,013,232 to 2,013,637 exact pixels of 2,016,000 with 33 per-capture ceilings tightened; 54 centred and 54 off-centre small rectangles ofpath-gradient-focus-small.json.gzreach 16,956 and 16,989 exact pixels of 16,992, from 16,161 and 16,894): a pixel on a fully focused axis's edge is a tie of every copy at once and takes the innermost copy whose other extent holds it, with the scan converter's span rule on the edge itself (left and top edges inside, right and bottom outside).Path gradients whose surround colours differ per vertex are Gouraud-shaded the way GDI+ shades them: one triangle per boundary edge, fanned from the centre, scan-converted in whole pixels (a span starts at the first pixel at or right of its left edge with that edge's colour, ends at the first pixel at or right of its right edge, and steps in 16.16 fixed point; device vertices round up to 1/16 pixel; translucent colours interpolate premultiplied). 120 random polygons are 98.8% exact with no pixel beyond one level (0.8% before), 60 translucent ones 99.3% (0.1% before), rotated and scaled ones 95.8-99.0%, and
grad-path-triangle-clampgoes from 1,421 to 13 differing pixels with none beyond one level (the tiled and mirrored triangles from about 6,000 to 70-72 at zero tolerance, and to 54 with none beyond one level once the apex pixel of each tile, which the fan leaves empty and native leaves unpainted, stays unpainted). FocusScales are ignored by native when the surrounds differ per vertex (40 captures with scales, 98.7% exact), and the differing-pixel ceilings of the 240 independent alpha controls fell from 255,177 to 33,604 in total at that step (846 now, the sum of the ceilings inpath-gradient-color-bounds.jsonafter the float32 copy rule below: 605 over the 120 uniform-surround controls and 241 over the 120 per-vertex ones); a per-vertex gradient with a Blend curve or an InterpolationColors preset keeps the previous model. Round 8 isolated the span (108 fans with exact end colours,path-gradient-span.json.gz): every pixel that is not an exact half-level tie has the nearest level of the exact interpolation (2,631,233 of 2,631,233), so the span is not a stepped delta, and a flat span at x.5 rounds up for 2^k pixels and up-then-down for an odd length, which weights the two ends separately in single precision rounded down. That reading lifts the 320 captures from 98.34% to 99.24% and the fivegrad-path-triangle-*fixtures from 13, 54, 54, 54, 54 to 12, 50, 50, 52, 52 differing pixels, but 14 of the 120 per-vertex alpha controls exceed their ceilings (7 exact ones left with 2 or 3 pixels), so it was not shipped in round 8 (see "Round 8, workstream R5" in parity-log.md). Round 9 found what that reading was missing: a span is measured from the centre colour (C + qa (n - j) + qb j,q = (end - C) / nrounded toward zero in single precision; 659,630 of 659,630 pixels of the flat swept spans with a non-negative offset), and so are the three kinds of edge (49,464 + 7,336 + 12,584 native edge rows, none differs). With that and three settings fitted to the controls the 320 captures rise from 98.34% to 99.36% exact and the fivegrad-path-triangle-*fixtures go from 13, 54, 54, 54, 54 to 4, 16, 18, 18, 16 differing pixels, and it is shipped (emf-plus-path-gradient-vertices.ts): the owner accepted that alpha control #137 goes from exact to one differing pixel (its ceiling inpath-gradient-color-bounds.jsonis 1; every other improved ceiling was tightened, 784 to 613 differing pixels over the 240 alpha controls), andgpx-text-pathgradfalls from 67 to 30 differing pixels; see "Round 9, workstream W5".Which copy holds a pixel of a uniform path gradient without a focus is computed the way native computes it, in float32 with every operation rounded toward minus infinity (
floatCopyIndex): the ray from the centre through the pixel meets the boundary edge of its fan triangle atu = (ay dx - ax dy) / (ex dy - ey dx), the boundary point isa + u e, the ratioris the pixel's distance over the boundary point's along the boundary point's larger coordinate, and the copy isfloor(N r + 1/2). A ratio that is a binary fraction stays exact and puts a tie pixel outside the copy, any other ratio falls short and puts it inside, and the rounding of the boundary point decides the slanted and along-the-edge pixels that no earlier rule explained. Every pixel of the single-edge sweeps is now exact (176,400 of 176,400 clockwise, 176,400 with the centre on a pixel centre, 176,400 counter-clockwise, 25,152 of the vertex-order set, 58,980 of the translated set; 176,222, 176,008, 176,222, 24,944 and 58,472 before), of 684 sheared rectangles at every slope (156,288 pixels, 2,356 off before) and of 1,720 corner triangles (248,716 pixels, 3,182 off before), of the 14 rectangles and 7 diamonds of the tie captures (46,868 and 15,056), and of the tip sweep (529 captures; 110, 216 and 31 pixels off before in the clamped triangles, tiled triangles and clamped ellipses). The colour controls rise to 632,109 of 640,000 opaque and 222,321 of 320,000 translucent exact pixels, the uniform alpha controls to 320,000 of 320,000, 115 of the 360 per-case ceilings tighten and none loosens, the 72 step rows rise from 25,394 to 25,492 of 25,568 pixels, and every step image becomes pixel-exact butimage 1 focus(15,998 of 16,000) andimage 3 blend(7,962 of 8,000).A pixel the nested copies (or the fan triangles) leave outside the boundary is left unpainted rather than given the smooth ratio. Native leaves the flat edges next to an ellipse's extremes empty (8 pixels of a 24-gon ellipse that the smooth ratio painted): the four tiled ellipses are now pixel-exact (12, 12, 16 and 16 differing pixels before) and so is
gpx-pen-pathgrad(2 before). A path gradient's steps and copies belong to the brush path alone: 45 native captures of a rectangle, a triangle and an ellipse brush through 1-, 6- and 20-pixel pens, 4- and 16-pixel ellipse outlines, single-bit text at 56 and 96 pixels and ellipse, polygon and rectangle fills paint 56,503 pixels, every one of them the colour of the full-canvas fill at the same place, so no gradient parameter follows the pen, the glyphs or the string. The residual ofgpx-text-pathgrad(0.692% with the font engine, 0.978% before) is glyph shape.Path gradients now preserve independent horizontal/vertical focus scales, including zero and fully focused axes. All seven rectangular and elliptical controls and seven triangular controls are within one channel level in PNG and embedded SVG image payloads. Curve boundaries match all 1,556 vertices in the native random/ellipse Flatten probe. Folded focus strips use odd coverage and can extend outside the outer polygon. Both collapsed triangle controls are within one channel level. Forty of 252 independent contour/order controls retain 57 pixels beyond one level; channel rounding and wrap sampling remain open. Exact native linear Blend lookup tables do not establish exact path-gradient sampling.
An isotropic focus is applied the way native applies it, in absolute device coordinates with float32 arithmetic rounded toward minus infinity (the boundary point, the point where the ray meets the focus polygon and
t = (P - I) / (O - I)): the 1,058,400 pixels of 2,400 rectangle captures at six foci go from 6,212 wrong to 781, the axis-aligned edges are exact bar 7 pixels, and the corner triangle from about 600 wrong of 72,549 to 129. Pixels within float noise of a copy's edge on a slanted edge whose larger boundary coordinate is inexact (about 8% of them) and the independent-scale strip solver remain open (see docs/parity-log.md); for independent scales the pixels the strip solver puts within 0.005 of a step of a copy's edge are decided by the exact containment of the scaled copy (round 10: the 12grad-path-focus-ellipse-*/-triangle-*fixtures with independent scales go from 176 differing pixels in total to 4, 2 ongrad-path-focus-ellipse-100-25and 2 on-triangle-75-25, and the 240 alpha controls from 613 to 230 differing pixels in total, the 252 focus contours from 2,351 to 254; the project owner accepted that five one-level ceilings, alpha controls 26 and 32 and contours 47, 75 and 82, now allow one two-level pixel).CompositingMode.SourceCopyfills of a translucent linear gradient are pixel-exact: the straight channel stored for a premultiplied ramp pixel isfloor(p * floor(255 * 65536 / a) / 65536)(49,000 of 49,000 native pixels; nearest rounding matched 6,269), and a partly covered antialiased edge scales the premultiplied colour and alpha by the coverage before that conversion (121 of 121 edge pixels of a 128-alpha ellipse).gpx-rec-compositingandgpx-rec-compositing-aawent from 475 and 645 one-level pixels to exact. The device-to-ramp matrix of any linear gradient is GDI+'s own float32 chain (round 11, read fromDpOutputLinearGradientSpanin gdiplus.dll: brush matrix times world matrix, the ramp-to-rectangle matrix times that, inverted, every operation rounded toward minus infinity; a brush recorded without a matrix gets the one GDI+ derives from its rectangle, a hair under the identity), sogpx-lin-sigma,gpx-pen-lingradandgpx-text-lingrad(2, 13 and 3 pixels one level off) are exact, as are all 8,196 steps of the brush sweeps oflinear-ramp-origin.json.gzand all 7,986 of the world-transform sweeps oflinear-ramp-world.json.gz.EMF+ pens on closed figures: a compound pen's bands are exact on a rectangle, ellipse, polygons, closed curve and rounded path, aliased and antialiased; an Inset pen is drawn at twice its width, centered, and clipped to the figure with GDI+'s hard clip (native
SetClip(path)+DrawPathgives the same pixels): the aliased sheets are exact for all three joins (0 of 240,000 pixels; 120 random polygons and curves are exact too,inset-outline.json.gz). Antialiased, GDI+ fills the outline of the surviving pixels, a polygon on whole-pixel coordinates (whatGraphicsPath.Widenreturns for an Inset pen) whose staircase corners are cut by a local rule (emf-plus-inset-outline.ts): the antialiased sheets are exact now too (6 of 240,000 pixels differed at the bottom tip of the triangle's hole: GDI+ traces a hole that touches itself at a corner as separate holes, and keeps set pixels apart everywhere else, 791 of 791 differing contacts of 3,000 random polygons,inset-contacts.json.gz), and 114 of the 120 random polygons are exact (130 pixels differ in the rest, at sharp tips and one-pixel-high notches). A round join through a turn of under about 8 degrees is a smooth vertex in GDI+ (one offset point, the straight edge 1/16 pixel inside;round-join-small-turn.json.gz, 360 of 360 exact), which also madegpx-rec-beziersandgpx-rec-beziers-aaexact. Round 8 captured the remaining Inset cases (inset-cases.json.gz,gpx-pen-inset-<dash|dashround|thin|half|multi|multiwind>-*): an Inset pen of 1.5 pixels or less is a nominal-width line (the sheets are exact; of 54 random paths 54 are exact antialiased and 50 aliased, the rest by 8 pixels at ties of the DDA); PixelOffsetMode Half is exact (the antialiased outline sits on the device pixels of the mask; 4.7% of the sheet differed before); a dashed Inset pen with flat dash caps is the doubled pen clipped to the figure (dash lengths in the pen's own width, dash offset in the doubled one: 0 and 55 of 240,000 pixels differ, aliased and antialiased, from 1,194 and 10,864; round 10, below); with round dash caps it is the band along the inside of each edge with the caps centred on it, also clipped (113 and 445 in round 8, from 19,586 and 27,929; 75 and 226 after round 10, below); and a path of several closed figures is clipped by the interior under the path's own fill mode, a pixel kept when an odd number of the figures hold it for the default Alternate mode (Winding: exact, 0 of 240,000; Alternate: 2 aliased and 133 antialiased, from 15,504 and 18,207), the antialiased outline taken for each figure's own pixels. Round 9 (dashes): GDI+ dashes the figure BEFORE widening and widens every dash as its own open figure (GraphicsPath.Widenof a dashed pen returns one closed polygon per dash,dash-widen.json.gz,DashWidenProbe.cs, 672 native outlines with their pixels). With a Round or Triangle DashCap a dash is straight for its length minus the pen width and the caps reach half a width past both ends; a dash shorter than the pen width is a dot whose straight part is 0.001 pen widths long (all 142 dots among 193 round-capped dashes of open lines: 0.002 for a width 2 pen, 0.0045 for 4.5, 0.008 for 8) and it still takes the cap's whole length of the pattern (the pattern 2, 1, 0.5, 1.5 of a width 2 pen repeats every 11 pixels, not 10): the converter kept the period, which put every later dash off (this was the "dashes shorter than the pen's width" gap: Inset round-dash cases, 60 paths, 4,543 to 36 differing aliased pixels and 8,690 to 244 antialiased, the Center round-dash control, 40 paths, 3,353 to 6 and 8,549 to 125,gpx-pen-inset-dashround-aliased113 to 76 and-aa445 to 231). A dash of an open line whose cap would reach the line's end is its last dash and takes the line's own end cap at the end of its straight part, and the first dash of an open line that starts within half a pen width of the start takes the line's start cap (round dashes of open lines: 154 to 2 aliased pixels over 54 paths, polylines 314 to 2, closed figures 109 over 54 paths to 8 over 102; Triangle caps 277, 177 and 73 to 2, 5 and 6). An Inset pen with a Triangle DashCap draws the band cut flat at the end of the straight part (11,286 to 80 aliased pixels over 48 sheet-figure cases; no tip). What is still missing: antialiased dots and short dashes differ by a few pixels (the native cap's control points are float values that round to 28.4 one step apart from the converter's, 66 of 102 closed figures and 37 of 54 lines exact antialiased), a concave vertex of a large Inset round-dash star (width 14: native dashes run past the vertex, two clusters of 22 and 28 aliased pixels ongpx-pen-inset-dashround), the staircase corners where two Inset rings cross (multi, 6 of 80 paths exact antialiased: the single-figure rule is wrong at 978 of 308,740 corners but at 26,468 of 1,028,198 on crossing paths, and 240 of 240 thin slivers,inset-slivers.json.gz, and axis-aligned crossings are exact, so it is the junction itself), two overlapping figures with nearly coincident edges (a sliver pixel, 721 pixels over 80 paths aliased), seven of 98 Beziers with round caps (1 to 33 pixels; the one large case is a near reversal where native extends a clipped miter 13.7 pixels), and the custom-cap 1-pixel pen (1/16 pixel float noise). Round 10 (dashes, the Widen oracle). A flat-dashed Inset pen is, pixel for pixel natively,SetClip(figure)plus a Center pen of twice the width with the same dash lengths in pixels and the same offset in doubled widths (0 of 24 sheet figures differ aliased), which is the converter's model; with round dash caps the same construction is far off (157 to 1,384 aliased pixels per figure), the native cap being a semicircle centred in the band.GraphicsPath.Widen(pen, new Matrix(), 0.25)is whatDrawPathdraws; the one-argumentWiden(pen)of the earlier probes ceils the coordinates of a path with a curve to sixths of a pixel (exact on lines and polygons), so curve cases read from it were off by up to 0.3 pixel. Against the right oracle the converter flattens and dashes curves exactly (6,389 of 6,466 cuts of 120 dashed Beziers within 0.05 pixel,dash-curve.json.gz) and two details were missing: a flat dash end whose corner would lie behind the offset point before it ends at that point (a last segment 1.1 to 1.6 pixels after a vertex of a width 28 pen), and a dash crossing the degenerate BezierAddArcleaves at the end of a rounded rectangle's second corner arc is two polygons.gpx-pen-inset-dash-aliasedis exact (28 before),-dash-aa55 (136),-dashround-aliased75 (76),-dashround-aa226 (231). Still missing: the antialiased corner rule at one-pixel notches and step ends (21 of 3,033 vertices of the flat sheet figures), the polygon corners of a round-dash pen's dots (0.001 to 0.004 pixel off, a straight part of 0.001 pen widths whose two sides are displaced against each other), and the two width 14 star clusters at concave vertices (22 and 28 pixels). Themultisheets are paths of overlapping closed polygons, not compound pens, and did not change. Round 11 (read from gdiplus.dll, supersedes the three "still missing" items above and the band model of round caps): an Inset pen isGpPath::GetWidenedPath: for each closed subpath it widens with a copy of the pen at twice its width and Center alignment (the dash pattern scaled by half that width, so in the pen's own width, and shortened byAdjustDashArrayForCapsby one pen width for a Round or Triangle cap; a closed figure's offset is2w x offset - w), converts the result to a region, intersects it with the region of the WHOLE path (its own fill mode), and converts the region back to a path (DpRegion::GetOutlinePoints,RegionToPath::DiagonalizePath,ConvertRegionOutputToWinding); every such outline is added to one path that is filled nonzero, aliased or antialiased. An open subpath of the same path is a Center pen of the pen's own width, not clipped, and its outline winds the other way round from the regions' outlines. Because the pen is the doubled one, a Round dash cap isSetDoubleRoundCap: a semicircle of a quarter of the doubled width over each half of it (only the inner one survives the clip along a straight edge, which looked like one cap centred in a band of the pen's own width; both show at a reflex vertex, which was the star clusters), and a Triangle cap leaves no tip. Results:inset-outline.json.gz120 of 120 antialiased renderings exact (114 before),inset-contacts.json.gz300 of 300 (249; the pairing of set pixels that touch at a corner is the region walker's, not a rule),gpx-pen-inset-dash-aa55 to 0,-dashround-aliased75 to 5,-dashround-aa226 to 32,-multi-aliased2 to 0,-multi-aa133 to 0 (the bounding-box test ofConvertRegionOutputToWindingreverses a loop inside another loop's box, so overlapping figures cancel each other where those loops overlap; 77 of 80 random overlapping-figure paths exact, from 49), all 48 Round and 46 of 48 Triangle sheet-figure renderings ofdash-widen.json.gz, and the newinset-dash.json.gz(113 captures: a star and an L with a dash swept over their reflex vertices, Triangle caps, a closed rectangle with open lines) 113 of 113 exact aliased and antialiased. The wholegpx-pen-inset-dashroundsheet is alsofill(outline(native mask))with 0 differing pixels, so what is left of it (5 aliased and 32 antialiased pixels, one-pixel flips on an ellipse, a closed curve and the star) is in the stroke mask itself. Open: the three random overlapping-figure paths with a width 2 pen (34 aliased pixels), the 5 pixels above (float32 arithmetic of the widener and dasher is the suspect: the converter widens in double precision, native in single, and the offsets of a dashed ellipse differ from it by 1e-5 to 1e-4 pixel), andGetDashCapInsetLength's Triangle cap: the widener has aSetTriangleCap(tip half the doubled width long) yet no tip shows, which the static reading does not explain.EMF+ dashes and round caps in single precision (round 12): GDI+ cuts a dash and builds its caps in float32 with every operation rounded down, and the last bit matters because the coordinates then go through the 28.4 conversion, where a value within 1e-5 of a rounding tie lands on the other side (the double precision widener put the cap end of a dash at 99.18945, 0.0002 of a 1/256 step above the tie; native holds it below). Read from
getDashData,CalculateGradientArray,GpPen::AdjustDashArrayForCapsandGpPathWidener::SetRoundCap/SetDoubleRoundCapand ported inemf-plus-widen-f32.ts: the gradient is(dx / len, dy / len)withlen = sqrt(dx*dx + dy*dy)in single precision; a cut point iscur + (next - cur) * (dashRemaining / segmentRemaining)and the rest of the segment issegmentRemaining - dashRemaining(not measured again from the cut point); a repeated point ends the dash so far (this is what splits a dash at the degenerate BezierAddArcleaves); a cap is the unit semicircle (Bezier constant 0.552284777 as a float) turned by(half * gy, -half * gx)and centred onp + (sum * (gy, -gx)) / 2, the double cap two such semicircles scaled by 0.5 and shifted by plus and minus 0.5. Checked bit for bit against 239GraphicsPath.Widendashes of Round-capped lines (the side point and the 7 control points of both caps,emf-plus-widen-f32.fixture.test.ts). Used for the doubled pen of an Inset stroke with Round dash caps only (the gate isdoubleRoundCap); the interior joins of a dash on a flattened curve are still the double precision model, and the caps of Center pens are still the double precision model too.
WMF
PS_INSIDEFRAMErectangles, ellipses, rounded rectangles, chords, pies and arcs match the native 0.5–10 px half-pixel sweeps exactly.wmf-shapes-scaled(0.96 device scale) is pixel-exact. At that scale an odd device pen width puts a curved shape's vertical edges on half a FIX and shears its points with height; 1,500 nativeGetPathcaptures (wmf-scaled-paths.json) match every Ellipse, Chord, Pie and Arc point for point, and all 148 odd-width RoundRects. A chord whose pen is as wide as its box (one of the 1,500) is a FIX off at four values: Windows still builds an 8 FIX sliver from the inverted box. An Ellipse or RoundRect with such a pen keeps the box without the pen's inset, as reproduced (wmf-scaled-paths.fixture.test.ts). RoundRects under cosmetic, wide and null pens match native at the identity and 0.96 scales for every corner size from 6 to 30 units. Arc, Chord and Pie paths follow Windows' angle and trigonometry model (an approximate arc tangent in 32 slope intervals per octant, a 128-gon for the sine and cosine, and tangent lines on the polygon points): of 900 native arcs, 898 paths match exactly under each arc direction and the other two differ by a single 1/16-pixel unit in one point.- Mirrored
LAYOUT_RTLcosmetic and wide line fixtures match Windows exactly. - Metric map modes default to a 96 dpi reference device. Set
wmfReferenceDpito a number or{ x, y }when the original physical-device resolution is known. Metafiles do not always record that information.
Other native controls
Additional native controls confirm preservation of SPVFS/SFVFS signed vector words (64 newly exact controls). General diagonal projection and movement rounding remains unresolved, and for the per-product candidate it depends on a native state that changed during 8 October 2026 (see Text above). Path gradients with uniform surrounds now interpolate unequal-alpha colors through premultiplied channels; 110 of 120 independent controls are within one level, with 15 remaining boundary/coverage pixels beyond one level (the per-capture ceilings of path-gradient-color-bounds.json). Varying surrounds are Gouraud fan triangles (see EMF+ above): all 120 of their independent controls have no pixel beyond one level (the same ceilings). The fractional HALFTONE kernel and vertical-first intermediate rounding match the measured central RGB crops in test-only helpers; native branch selection is a rule now and the measured filtered engines are dispatched (see above), the run model included for fractional enlargements up to 5x.