ImagePyramid
✖
ImagePyramid
returns a Gaussian or Laplacian pyramid depending of the specified pyrtype.
Details and Options



- Image pyramid is a multi-resolution representation of an image to facilitate efficient multiscale processing. Typical applications include noise removal, image blending, texture synthesis and efficient rendering.
- An image pyramid consists of several images with consecutively lower resolutions. Typically, specific levels of the pyramid are processed, and the result is reconstructed using the inverse process.
- ImagePyramid works with arbitrary 2D and 3D images.
- Use InverseImagePyramid to reconstruct the image from an image pyramid.
- The pyramid type pyrtype can be any of the following:
-
"Lowpass" or "Gaussian" iteratively blurs and downsamples "Bandpass" or "Laplacian" difference pyramid by upsampling and subtracting the lower levels from the upper levels {"Lowpass",ker} use ker for downsampling {"Bandpass",ker1,ker2} use ker1 for downsampling and ker2 for upsampling pyr use specifications of a reference pyramid pyr - Kernel specification ker can be given by an array or any valid setting for Resampling.
- By default, ImagePyramid[image] creates a Gaussian pyramid with all possible levels using a scaling factor of 2.
- Using pyr["Properties"], all available properties are returned.
- Using pyr["prop"], properties or content of the constructed image pyramid can be extracted.
- Available properties "prop" are:
-
levels extract images as specific levels "ImageDimensions" dimensions of the original image "LevelCount" the number of levels available "Levels" all images "LowpassKernel" lowpass kernel used when creating the pyramid "HighpassKernel" highpass kernel used when creating the pyramid "Padding" padding scheme used when creating the pyramid "ScalingFactor" the scaling factor used when creating the pyramid "Type" type of the pyramid, "Lowpass" or "Bandpass" - Level specification levels can take any of the following settings:
-
All all levels of the pyramid n the n level
-n counts from the last level {n1,n2,…} a list of level indices m;;n levels m through n m;;n;;s levels m through n with step s - ImagePyramid preserves the image type when creating a lowpass pyramid and returns a pyramid of a real type when creating a bandpass pyramid.
- By default, a "Reversed" padding is used. Use the Padding option to specify other settings.

Examples
open allclose allBasic Examples (2)Summary of the most common use cases

https://wolfram.com/xid/0k721hum0d6t9-h92c44


https://wolfram.com/xid/0k721hum0d6t9-u8ddv7


https://wolfram.com/xid/0k721hum0d6t9-qx80b

View all image levels, adjusting the images to see the details:

https://wolfram.com/xid/0k721hum0d6t9-pqt0wt

Scope (7)Survey of the scope of standard use cases
Data (3)
Lowpass pyramid of a 2D image:

https://wolfram.com/xid/0k721hum0d6t9-j6zz1b


https://wolfram.com/xid/0k721hum0d6t9-yvwb32

Dimensions are halved at each level:

https://wolfram.com/xid/0k721hum0d6t9-qesrml

Lowpass pyramid of a 3D image:

https://wolfram.com/xid/0k721hum0d6t9-m9iyn9

https://wolfram.com/xid/0k721hum0d6t9-g0t0oi


https://wolfram.com/xid/0k721hum0d6t9-ncnj2


https://wolfram.com/xid/0k721hum0d6t9-j15hi1

Lowpass pyramid of a partially transparent image:

https://wolfram.com/xid/0k721hum0d6t9-57sqzu

https://wolfram.com/xid/0k721hum0d6t9-2tvvm0


https://wolfram.com/xid/0k721hum0d6t9-byq9rf


https://wolfram.com/xid/0k721hum0d6t9-t5zncl

Parameters (4)
The default lowpass kernel applied in each level before downsampling is the Gaussian kernel:

https://wolfram.com/xid/0k721hum0d6t9-eftcak

https://wolfram.com/xid/0k721hum0d6t9-q6c3da

https://wolfram.com/xid/0k721hum0d6t9-7u4ljo


https://wolfram.com/xid/0k721hum0d6t9-dlkd8e

Use a binomial kernel instead:

https://wolfram.com/xid/0k721hum0d6t9-v0xv01

https://wolfram.com/xid/0k721hum0d6t9-jlv7dd


https://wolfram.com/xid/0k721hum0d6t9-5e2nw6


https://wolfram.com/xid/0k721hum0d6t9-263q34

Use a Gaussian kernel with standard deviation σ equal to half the downsampling factor a:

https://wolfram.com/xid/0k721hum0d6t9-414d1q


https://wolfram.com/xid/0k721hum0d6t9-61r6ui


https://wolfram.com/xid/0k721hum0d6t9-0iyg0v

Specify the number of levels to be returned:

https://wolfram.com/xid/0k721hum0d6t9-6yihgz


https://wolfram.com/xid/0k721hum0d6t9-fgvlm1

Specify an image size that is smaller than or equal to the smallest image in the pyramid:

https://wolfram.com/xid/0k721hum0d6t9-tfywkm

This pyramid has two levels. The next pyramid level of size 50×38 would have been smaller than 50×50:

https://wolfram.com/xid/0k721hum0d6t9-gc2vyb

The default downsampling factor between successive levels is 2:

https://wolfram.com/xid/0k721hum0d6t9-g9n9aq


https://wolfram.com/xid/0k721hum0d6t9-4wm5ke

Specify a downsampling factor of 5:

https://wolfram.com/xid/0k721hum0d6t9-2pmwmw


https://wolfram.com/xid/0k721hum0d6t9-f5p12l

Options (1)Common values & functionality for each option
Padding (1)
The default padding is "Reversed":

https://wolfram.com/xid/0k721hum0d6t9-z4hl11

https://wolfram.com/xid/0k721hum0d6t9-b6huoe


https://wolfram.com/xid/0k721hum0d6t9-7jjwi6


https://wolfram.com/xid/0k721hum0d6t9-8uddry


https://wolfram.com/xid/0k721hum0d6t9-skixti


https://wolfram.com/xid/0k721hum0d6t9-ex6rco


https://wolfram.com/xid/0k721hum0d6t9-spggn2

Applications (6)Sample problems that can be solved with this function
Efficient Image Viewer (1)
Convert a large image into a pyramid for faster viewing:

https://wolfram.com/xid/0k721hum0d6t9-gp2dsl

https://wolfram.com/xid/0k721hum0d6t9-qj4haz

View the image with width 320:

https://wolfram.com/xid/0k721hum0d6t9-i0b7pu

Compare the timings for image retrieval:

https://wolfram.com/xid/0k721hum0d6t9-p5i98w


https://wolfram.com/xid/0k721hum0d6t9-upbsz2

Multiscale Feature Detection (3)
Apply a gradient filter at several scales simultaneously:

https://wolfram.com/xid/0k721hum0d6t9-l8n6pu

https://wolfram.com/xid/0k721hum0d6t9-twzhrv


https://wolfram.com/xid/0k721hum0d6t9-u9gw70
Reconstruct assuming a Laplacian pyramid to add up features extracted from all levels:

https://wolfram.com/xid/0k721hum0d6t9-3lal80

Alter pyramid levels and type to detect mountain ridges at all scales:

https://wolfram.com/xid/0k721hum0d6t9-urm9vd

https://wolfram.com/xid/0k721hum0d6t9-3k95en


https://wolfram.com/xid/0k721hum0d6t9-ku8yv8

Reconstruct assuming a Laplacian pyramid to add up features extracted from all levels:

https://wolfram.com/xid/0k721hum0d6t9-pqbi4l

Perform a multiscale saliency filtering:

https://wolfram.com/xid/0k721hum0d6t9-brlxli
Apply ImageSaliencyFilter to an image:

https://wolfram.com/xid/0k721hum0d6t9-5kjufg

Apply a saliency filter to all levels of the image pyramid to get a multiscale result:

https://wolfram.com/xid/0k721hum0d6t9-zsdkcv

https://wolfram.com/xid/0k721hum0d6t9-utukm5
Use Laplacian reconstruction to add up filter responses at all levels:

https://wolfram.com/xid/0k721hum0d6t9-10u65g

Image Effects (2)

https://wolfram.com/xid/0k721hum0d6t9-dhb2zj

Extract, negate and reinsert the three bottom levels of the image pyramid:

https://wolfram.com/xid/0k721hum0d6t9-7a4qdz

Reconstruct the image pyramid to exhibit the visual effect:

https://wolfram.com/xid/0k721hum0d6t9-c15hz6

Merge two images at just one scale:

https://wolfram.com/xid/0k721hum0d6t9-g3yhze

https://wolfram.com/xid/0k721hum0d6t9-pvff1j

https://wolfram.com/xid/0k721hum0d6t9-32mwvh

Merge the two images at all scales:

https://wolfram.com/xid/0k721hum0d6t9-yd3avo

https://wolfram.com/xid/0k721hum0d6t9-fqgu1j


https://wolfram.com/xid/0k721hum0d6t9-6lg5xn

Possible Issues (1)Common pitfalls and unexpected behavior
Images with constant alpha-channel result in Laplacian image pyramids that appear to be empty:

https://wolfram.com/xid/0k721hum0d6t9-2l6zqs

https://wolfram.com/xid/0k721hum0d6t9-gug0mp


https://wolfram.com/xid/0k721hum0d6t9-y5mj8
All pyramid levels except the last one will have an alpha channel equal to 0 and appear invisible:

https://wolfram.com/xid/0k721hum0d6t9-8qsfkz

The image reconstruction works, since the data in the color channel is present and the alpha channel of the fully opaque last level contributes to the correct alpha channel for the reconstructed image:

https://wolfram.com/xid/0k721hum0d6t9-z1el5

Wolfram Research (2019), ImagePyramid, Wolfram Language function, https://reference.wolfram.com/language/ref/ImagePyramid.html.
Text
Wolfram Research (2019), ImagePyramid, Wolfram Language function, https://reference.wolfram.com/language/ref/ImagePyramid.html.
Wolfram Research (2019), ImagePyramid, Wolfram Language function, https://reference.wolfram.com/language/ref/ImagePyramid.html.
CMS
Wolfram Language. 2019. "ImagePyramid." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ImagePyramid.html.
Wolfram Language. 2019. "ImagePyramid." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ImagePyramid.html.
APA
Wolfram Language. (2019). ImagePyramid. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImagePyramid.html
Wolfram Language. (2019). ImagePyramid. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImagePyramid.html
BibTeX
@misc{reference.wolfram_2025_imagepyramid, author="Wolfram Research", title="{ImagePyramid}", year="2019", howpublished="\url{https://reference.wolfram.com/language/ref/ImagePyramid.html}", note=[Accessed: 24-March-2025
]}
BibLaTeX
@online{reference.wolfram_2025_imagepyramid, organization={Wolfram Research}, title={ImagePyramid}, year={2019}, url={https://reference.wolfram.com/language/ref/ImagePyramid.html}, note=[Accessed: 24-March-2025
]}