Undoes the pre-blending of colour against a matte colour (Matte): c = m + (c′ − m) / α, clamped to each component's range;
a sample with α = 0 becomes the matte colour.
public static void Unpremultiply(Span<float> colors, int components, ReadOnlySpan<float> alpha, ReadOnlySpan<float> matte, ReadOnlySpan<ComponentRange> ranges)
Decoded components (after the Decode array; palette entries for an Indexed image), interleaved; changed in place.
The number of components per sample: the length of the matte array.
The soft mask's decoded value for each sample, 0 to 1.
The matte colour, one value per component.
The range of each component, for the clamp.
ISO 32000-2 §11.6.5.2, Table 144 and the formula after it: done in the image's own colour space, before conversion.