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.

Details and Options

  • ConstantImage by default chooses a color space compatible with the given value specification val.
  • Constant value val can be any of the following:
  • vgray level from 0 to 1
    {c1,c2,}different channel values ci
    colorany color directive
  • Size specification size can be one of the following:
  • side2D image of size {side,side}
    {width,height}2D image size specification
    {width,depth,height}3D image size specification
  • ConstantImage[val] is equivalent to ConstantImage[val,{150,150}]. »
  • The default "type" is taken to be "Real".
  • The following options are supported:
  • ColorSpaceAutomaticcolor space of the output image
    ImageSizeAutomaticdisplay image size

Examples

open allclose all

Basic Examples  (3)

Create a constant gray image:

In[1]:=
Click for copyable input
Out[1]=

Create a constant color image:

In[1]:=
Click for copyable input
Out[1]=

Create a constant 3D image:

In[1]:=
Click for copyable input
Out[1]=

Scope  (4)

Options  (1)

Applications  (1)

Properties & Relations  (1)

See Also

RGBColor  Image  RandomImage  ImageData  ConstantArray  LinearGradientImage  Background

Introduced in 2014
(10.0)
| Updated in 2017
(11.1)