Skip to main content

Function: convertFloat32ToLinearColorSpace()

convertFloat32ToLinearColorSpace(data, _width, _height, from, to): Float32Array

Convert Float32Array RGBA pixel data from one linear color space to another. If from === to, returns the original data without copying. Otherwise creates a new Float32Array (does not mutate input).

Parameters​

data​

Float32Array

RGBA Float32Array

_width​

number

Image width

_height​

number

Image height

from​

LinearColorSpace

Source linear color space

to​

LinearColorSpace

Target linear color space

Returns​

Float32Array

Original data if no conversion; otherwise new Float32Array with converted pixels