Skip to content
Chung Leong edited this page Jan 10, 2022 · 3 revisions

rgb_demult - Remove pre-multiplication from RGBA values

float[4] rgb_demult( float[4] $pixel )

rgb_demult() divides the red, blue, and green values of a pixel by its alpha value. It's used to reverse the effect of [rgb_premult].

Parameters:

pixel - The RGBA values to convert. It can be a single four-element array or an array of such arrays.

Return Value:

An array containing RGBA values that are no longer pre-multiplied. The return value will have the same length as pixel.

Version

1.4 and above.

Clone this wiki locally