Downsample

Downsample[array,n]

returns a downsampled version of the array by sampling every n^(th) element.

Downsample[array,n,offset]

starts sampling from the element at position offset.

Downsample[image,]

downsamples an image.

Details

  • In Downsample[array,], array can be an array of any rank.
  • Downsample works with arrays of any rank and 2D and 3D images.
  • Downsample[array,{n1,n2,}] samples every ni^(th) element in the i^(th) dimension.
  • Downsample[array,n] is equivalent to Downsample[array,n,1].
  • In Downsample[array,n,offset], the offset has to be an integer between 1 and n.

Examples

open allclose all

Basic Examples  (4)

Downsample a list by a factor of 2:

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

Downsample a 2D array:

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

Downsample an image by a factor of 2:

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

Downsample a 3D image:

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

Scope  (4)

Applications  (2)

See Also

Upsample  ArrayResample  ImageResize  Take  Part  Partition  RandomSample  Short

Introduced in 2012
(9.0)
| Updated in 2016
(10.4)