({{, (RefLink[ImagePartition, paclet:ref/ImagePartition])[image,s] 
partitions an image into an array of s×s-pixel subimages.}, {, (RefLink[ImagePartition, paclet:ref/ImagePartition])[image,{w,h}]
partitions an image into an array of subimages of pixel width w and pixel height h.}, {, (RefLink[ImagePartition, paclet:ref/ImagePartition])[image,{w,h},{dw,dh}]
uses pixel offsets dw and dh.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[ImagePartition, paclet:ref/ImagePartition]) returns an array of (RefLink[Image, paclet:ref/Image]) objects.

(RefLink[ImagePartition, paclet:ref/ImagePartition]) by default picks out non-overlapping subimages.

(RefLink[ImagePartition, paclet:ref/ImagePartition])[image,s] generates as many s×s subimages as possible, dropping incomplete subimages at the edges.

(RefLink[ImagePartition, paclet:ref/ImagePartition])[image,{s}] instead includes incomplete subimages at the edges.

In (RefLink[ImagePartition, paclet:ref/ImagePartition])[image,{wspec,hspec},…], the following forms can be used for wspec and hspec:

(RefLink[ImagePartition, paclet:ref/ImagePartition]) supports the option (RefLink[Padding, paclet:ref/Padding]).

The default setting is (RefLink[Padding, paclet:ref/Padding])->(RefLink[None, paclet:ref/None]), which drops subimages at the edges whose sizes are not consistent with {wspec,hspec}.

All other standard settings for (RefLink[Padding, paclet:ref/Padding]) are also supported.

(RefLink[ImagePartition, paclet:ref/ImagePartition]) also works with (RefLink[Image3D, paclet:ref/Image3D]) objects.

OpenersPrimaryExamplesSection(Spacer1)Examples  (12)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Partition an image into blocks of size 16 by 16:

ImagePartition[, 16] // Grid

OpenersExampleSection1(Spacer1)Scope  (5)

OpenersExampleSubsection0(Spacer1)Data  (2)

Partition a color image into equal-size blocks, dropping some pixels at the borders:

ImagePartition[ , 32]// Grid

Partition a 3D image:

ImagePartition[,{40}]

OpenersExampleSubsection1(Spacer1)Parameters  (3)

Specify the partition size using scaled dimensions:

ImagePartition[,Scaled[1/3]]//Grid

Partition into blocks not larger than the specified scaled dimensions:

ImagePartition[,{Scaled[1/3]}]//Grid

Specify different scaled dimensions in horizontal and vertical directions:

ImagePartition[,Scaled[{1/3,1/2}]]//Grid

OpenersExampleSection2(Spacer1)Options  (1)

OpenersExampleSubsection2(Spacer1)Padding  (1)

By default, (RefLink[Padding, paclet:ref/Padding])->(RefLink[None, paclet:ref/None]) is used:

i=;
ImagePartition[i,45]//Grid

Pad the image with a specified color:

ImagePartition[i,45,Padding->Red]//Grid

Specify a different padding scheme:

ImagePartition[i,45,Padding->"Fixed"]//Grid

OpenersExampleSection3(Spacer1)Applications  (3)

Ordinal measurement descriptor of an image:

i=;

Partition the image into subimages:

plist=Flatten[ImagePartition[i,{Scaled[1/8]}]]

Compute the ordering of mean intensity of each image:

Ordering[ImageMeasurements[#,"MeanIntensity"]&/@plist]

Show the ordered partitions:

plist[[%]]

Add some spacing between image partitions:

i=;

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]]

OpenersExampleSection4(Spacer1)Properties & Relations  (1)

(RefLink[ImagePartition, paclet:ref/ImagePartition]) and (RefLink[ImageAssemble, paclet:ref/ImageAssemble]) are reverse operations:

i=RandomImage[1,{10,10}];
ImageDistance[i,ImageAssemble[ImagePartition[i,{25}]]]

OpenersExampleSection5(Spacer1)Neat Examples  (1)

Create a mosaic effect by averaging colors in small partitions:

Map[MeanFilter[#,10]&, ImagePartition[, 10],{2}]//ImageAssemble

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ImageAssemble, paclet:ref/ImageAssemble])  ▪  (RefLink[ImageCollage, paclet:ref/ImageCollage])  ▪  (RefLink[ImageFilter, paclet:ref/ImageFilter])  ▪  (RefLink[Partition, paclet:ref/Partition])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Basic Image Manipulation, paclet:guide/BasicImageManipulation])}, {▪(RefLinkPlain[Geometric Operations, paclet:guide/ImageGeometry])}, {▪(RefLinkPlain[Image Composition, paclet:guide/ImageComposition])}})}})