Raster

Raster[{{a11,a12,},}]

is a two-dimensional graphics primitive which represents a rectangular array of gray cells.

Raster[{{{r11,g11,b11},},}]

represents an array of RGB color cells.

Raster[{{{r11,g11,b11,α11},},}]

represents an array of color cells with opacity αij.

Raster[{{{a11,α11},},}]

represents an array of gray cells with the specified opacities.

Details and Options

  • Raster[array,ColorFunction->f] specifies that each cell should be colored using the graphics directives obtained by applying the function f to the value specified for that cell.
  • If array has dimensions {n,m}, then Raster[array] is assumed to occupy the rectangle Rectangle[{0,0},{m,n}]. »
  • Raster[array,{{xmin,ymin},{xmax,ymax}}] specifies that the raster should be taken instead to fill the rectangle Rectangle[{xmin,ymin},{xmax,ymax}]. »
  • Scaled and Offset can be used to specify the coordinates for the rectangle.
  • Raster[array,Automatic] is equivalent to Raster[array,{{0,0},{m,n}}].
  • Raster[array,rect,{amin,amax}] specifies that cell values should be scaled so that amin corresponds to 0 and amax corresponds to 1. Cell values outside this range are clipped to be 0 or 1.
  • array can be a SparseArray object.
  • Image[Raster[]] converts a Raster object to an image.

Examples

open allclose all

Basic Examples  (4)

Rectangular array of gray cells:

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

Array of RGB color cells:

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

Array of gray cells with opacity:

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

Array of RGB cells with opacity:

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

Scope  (14)

Generalizations & Extensions  (1)

Options  (4)

Applications  (3)

Properties & Relations  (7)

Possible Issues  (1)

Neat Examples  (1)

See Also

ArrayPlot  ListDensityPlot  Raster3D  GraphicsGrid  Rasterize

Introduced in 1991
(2.0)
| Updated in 2010
(8.0)