Downsample[array,n]
returns a downsampled version of the array by sampling every n
element.
Downsample[array,n,offset]
starts sampling from the element at position offset.
Downsample[image,…]
downsamples an image.
Downsample
Downsample[array,n]
returns a downsampled version of the array by sampling every n
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
element in the i
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 all close allBasic Examples (4)
Downsample a list by a factor of 2:
Downsample[Range[10], 2]Downsample[(| | | |
| - | - | - |
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 9 |), 2]//MatrixFormDownsample an image by a factor of 2:
Downsample[[image], 2]i = Image3D[ExampleData[{"TestImage3D", "CTengine"}], ImageSize -> All]Downsample[i, 2]Scope (4)
Downsample a list by a factor of 3:
Downsample[Range[10], 3]Downsample[Range[10], 3, 2]Use a different downsampling factor in each dimension:
Downsample[(| | | |
| - | - | - |
| 1 | 2 | 3 |
| 4 | 5 | 6 |
| 7 | 8 | 9 |), {1, 2}]//MatrixFormDownsample[{a, b, c, d, e, f}, 2]Downsample[[image], 2]Downsample using an offset of 2:
Downsample[[image], 2, 2]Applications (2)
Create an image pyramid using iterative blurring and downsampling:
i = [image];NestList[Downsample[Blur[#, 1], 2]&, i, 4]Use a smoothing filter to downsample a signal:
q = {(1/4), (1/4), (1/4), (1/4)};list = RandomReal[1, 16];res1 = Downsample[ListConvolve[q, list], 2]A faster implementation would add convolutions on the downsampled signal and downsampled filter:
res2 = ListConvolve[Downsample[q, 2], Downsample[list, 2]]res3 = ListConvolve[Downsample[q, 2, 2], Downsample[list, 2, 2]]res4 = res2 + res3res1 - res4Related Guides
Text
Wolfram Research (2012), Downsample, Wolfram Language function, https://reference.wolfram.com/language/ref/Downsample.html (updated 2016).
CMS
Wolfram Language. 2012. "Downsample." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/Downsample.html.
APA
Wolfram Language. (2012). Downsample. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Downsample.html
BibTeX
@misc{reference.wolfram_2026_downsample, author="Wolfram Research", title="{Downsample}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/Downsample.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_downsample, organization={Wolfram Research}, title={Downsample}, year={2016}, url={https://reference.wolfram.com/language/ref/Downsample.html}, note=[Accessed: 12-June-2026]}