ImagePartition[image,s]
partitions an image into an array of ss-pixel subimages.
ImagePartition[image,{w,h}]
partitions an image into an array of subimages of pixel width w and pixel height h.
ImagePartition[image,{w,h},{dw,dh}]
uses pixel offsets dw and dh.
ImagePartition
ImagePartition[image,s]
partitions an image into an array of ss-pixel subimages.
ImagePartition[image,{w,h}]
partitions an image into an array of subimages of pixel width w and pixel height h.
ImagePartition[image,{w,h},{dw,dh}]
uses pixel offsets dw and dh.
Details and Options
- ImagePartition returns an array of smaller overlapping or non-overlapping subimages.
- ImagePartition works with 2D and 3D images.
- ImagePartition by default picks out non-overlapping subimages.
- ImagePartition[image,s] generates as many ss subimages as possible, dropping incomplete subimages at the edges.
- ImagePartition[image,{s}] instead includes incomplete subimages at the edges.
- In ImagePartition[image,{wspec,hspec},…], the following forms can be used for wspec and hspec:
-
s allow only size s UpTo[s] allow any size up to s Scaled[a] allow a multiple a of the size {Scaled[a]} allow any size up to the multiple a of the size {smin,smax} allow any size smin through smax - ImagePartition supports the option Padding.
- The default setting is Padding->None, which drops subimages at the edges whose sizes are not consistent with {wspec,hspec}.
Examples
open all close allBasic Examples (1)
Scope (5)
Data (2)
Parameters (3)
Specify the partition size using scaled dimensions:
ImagePartition[[image], Scaled[1 / 3]]//GridPartition into blocks not larger than the specified scaled dimensions:
ImagePartition[[image], {Scaled[1 / 3]}]//GridSpecify different scaled dimensions in horizontal and vertical directions:
ImagePartition[[image], Scaled[{1 / 3, 1 / 2}]]//GridOptions (1)
Padding (1)
By default, Padding->None is used:
i = [image];
ImagePartition[i, 45]//GridPad the image with a specified color:
ImagePartition[i, 45, Padding -> Red]//GridSpecify a different padding scheme:
ImagePartition[i, 45, Padding -> "Fixed"]//GridApplications (3)
Ordinal measurement descriptor of an image:
i = [image];Partition the image into subimages:
list = Flatten[ImagePartition[i, {Scaled[1 / 8]}]]Compute the ordering of mean intensity of each image:
SortBy[list, ImageMeasurements[#, "MeanIntensity"]&]Add some spacing between image partitions:
i = [image];ImagePad[ImageAssemble[ImagePartition[i, {Scaled[1 / 4]}] /. i_Image :> ImagePad[i, 5, Gray]], 5, Automatic]Add spacing between 3D partitions:
engine = ExampleData[{"TestImage3D", "CTengine"}]ImageAssemble[ImagePartition[engine, {Scaled[1 / 2]}] /. i_Image3D :> ImagePad[i, 20, 0]]Properties & Relations (1)
ImagePartition and ImageAssemble are reverse operations:
i = RandomImage[1, {10, 10}];
ImageDistance[i, ImageAssemble[ImagePartition[i, {25}]]]See Also
ImageAssemble ImageCollage ImageFilter Partition
Function Repository: QuadtreeImageDecomposition
Related Guides
History
Introduced in 2008 (7.0) | Updated in 2012 (9.0) ▪ 2015 (10.3)
Text
Wolfram Research (2008), ImagePartition, Wolfram Language function, https://reference.wolfram.com/language/ref/ImagePartition.html (updated 2015).
CMS
Wolfram Language. 2008. "ImagePartition." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/ImagePartition.html.
APA
Wolfram Language. (2008). ImagePartition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImagePartition.html
BibTeX
@misc{reference.wolfram_2026_imagepartition, author="Wolfram Research", title="{ImagePartition}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/ImagePartition.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_imagepartition, organization={Wolfram Research}, title={ImagePartition}, year={2015}, url={https://reference.wolfram.com/language/ref/ImagePartition.html}, note=[Accessed: 13-June-2026]}