Skip to content

colorChange

Computational photographyfunctionOpenCV 5.0.0
import { colorChange } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSsrc, mask, dst, red_mul
FUNCTIONcolorChange
RETURN TYPEvoid
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Given an original color image, two differently colored versions of this image can be mixed seamlessly.

colorChange(src: Mat, mask: Mat, dst: Mat, red_mul: number, green_mul: number, blue_mul: number): void;
4 available overloads
colorChange(src: Mat, mask: Mat, dst: Mat): void;
colorChange(src: Mat, mask: Mat, dst: Mat, red_mul: number): void;
colorChange(src: Mat, mask: Mat, dst: Mat, red_mul: number, green_mul: number): void;
colorChange(src: Mat, mask: Mat, dst: Mat, red_mul: number, green_mul: number, blue_mul: number): void;
src

Input 8-bit 3-channel image.

mask

Input 8-bit 1 or 3-channel image.

dst

Output destination, filled by the native operation. Output image with the same size and type as src .

red_mul

R-channel multiply factor.

green_mul

G-channel multiply factor.

blue_mul

B-channel multiply factor.

Multiplication factor is between .5 to 2.5.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.