toSampledRgbaBytes
The straight RGBA bitmap a canvas draws with sampling, of KiteImageSampling.rasterWidth by KiteImageSampling.rasterHeight pixels. Power-of-two averaging keeps decoding and colour conversion bounded; a filter widened to cover each destination pixel handles the remaining reduction (#626). ISO 32000-1, 8.9.5.3 leaves the interpolation filter to the reader.
A same-resolution PDF /SMask without /Matte filters independently of its colour image (11.6.5.3). Embedded opacity, colour keys and matte-corrected colours retain alpha-weighted filtering. Invalid or unsupported samples return null as in toRgbaBytes.