WLJS LogoWLJS Notebook

ConstantImage

ConstantImage[val, size] gives an image of the specified size with constant pixel values of val.

ConstantImage[val, size, "type"] gives an image converted to the specified type.

Examples

Create a red image:

ConstantImage[Red, {100, 100}]

Create a grayscale image:

ConstantImage[0.5, {50, 50}]

Please visit the official Wolfram Language Reference for more details.

On this page