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:
  • sallow 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 allclose all

Basic Examples  (1)

Partition an image into blocks of size 16 by 16:

Scope  (5)

Data  (2)

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

Partition a 3D image:

Parameters  (3)

Specify the partition size using scaled dimensions:

Partition into blocks not larger than the specified scaled dimensions:

Specify different scaled dimensions in horizontal and vertical directions:

Options  (1)

Padding  (1)

By default, Padding->None is used:

Pad the image with a specified color:

Specify a different padding scheme:

Applications  (3)

Ordinal measurement descriptor of an image:

Partition the image into subimages:

Compute the ordering of mean intensity of each image:

Add some spacing between image partitions:

Add spacing between 3D partitions:

Properties & Relations  (1)

ImagePartition and ImageAssemble are reverse operations:

Neat Examples  (1)

Create a mosaic effect by averaging colors in small partitions:

Wolfram Research (2008), ImagePartition, Wolfram Language function, https://reference.wolfram.com/language/ref/ImagePartition.html (updated 2015).

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_2024_imagepartition, author="Wolfram Research", title="{ImagePartition}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/ImagePartition.html}", note=[Accessed: 22-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_imagepartition, organization={Wolfram Research}, title={ImagePartition}, year={2015}, url={https://reference.wolfram.com/language/ref/ImagePartition.html}, note=[Accessed: 22-December-2024 ]}