ImageCollage
✖
ImageCollage
creates a collage of images imagei based on their corresponding weights wi.
also creates a collage of images imagei based on their corresponding weights wi.
also creates a collage of images imagei based on their corresponding weights wi.
also creates a collage of images imagei based on their corresponding weights wi.
Details and Options


- ImageCollage creates a collage of a list of images and can be used to create a compact visualization of photographs, graphics, etc.
- ImageCollage[w->{image1,image2,…}] assumes the same weight w for all imagei.
- Weights wi can be either of one of the following forms:
-
w final area proportional to w Scaled[s] final area proportional to s multiplied by the original area - Possible values for fitting include:
-
"Fill" fit the smaller dimension; crop the other if necessary "Fit" fit the whole image; keep the aspect ratio; pad if necessary "Stretch" stretch the image to fit by resampling - The following options can be specified:
-
Background GrayLevel[0.2] background color ImagePadding None padding size to use around each image ImageSize Automatic display size of the collage Method Automatic method to use for packing images Padding Automatic padding scheme to use around each image Resampling Automatic resampling method - Possible settings for ImagePadding are:
-
None no padding m the same padding on all sides {m,n} m pixels on left and right, n pixels on bottom and top {{left,right},{bottom,top}} different padding on different sides - Method can take one of the following settings:
-
"Rows" arrange in horizontal layers "Columns" arrange in vertical layers "Grid" a regular grid of images "ClosestPacking" closest packing from the top left
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Create an image collage from a list of images:

https://wolfram.com/xid/0btnv30o7q8e-5stlxo

Create a collage from a weighted list of images:

https://wolfram.com/xid/0btnv30o7q8e-nsyr7r

Collage of flags of G7 countries, weighted by their population:

https://wolfram.com/xid/0btnv30o7q8e-5l4vwx


https://wolfram.com/xid/0btnv30o7q8e-iivgfe

Scope (4)Survey of the scope of standard use cases
Weights (2)
With no weights specified, almost-equal weights are assumed:

https://wolfram.com/xid/0btnv30o7q8e-wj8f2b
Images will appear to have roughly the same area:

https://wolfram.com/xid/0btnv30o7q8e-hu7e7i

Absolute weights represent a relationship between image areas in the collage:

https://wolfram.com/xid/0btnv30o7q8e-7rqbg0

Scaled weights get multiplied with original image dimensions:

https://wolfram.com/xid/0btnv30o7q8e-jv30h8

Use Scaled[1] as the weight for all images to preserve original image area ratios:

https://wolfram.com/xid/0btnv30o7q8e-spspmj

Compatible Quantity objects can also be used as weights:

https://wolfram.com/xid/0btnv30o7q8e-gf6n4w

https://wolfram.com/xid/0btnv30o7q8e-mtlo65

Fitting (1)
Size (1)
If no size is specified, the collage size is influenced by the original dimensions as well as the method:

https://wolfram.com/xid/0btnv30o7q8e-nnvj10

https://wolfram.com/xid/0btnv30o7q8e-miw2c7

Specify the output image width:

https://wolfram.com/xid/0btnv30o7q8e-3b4jj0

Specify the width and height of the output image:

https://wolfram.com/xid/0btnv30o7q8e-uu8171


https://wolfram.com/xid/0btnv30o7q8e-44xxek

Options (12)Common values & functionality for each option
Background (4)
By default, the background is filled with GrayLevel[0.2]:

https://wolfram.com/xid/0btnv30o7q8e-id1ju9


https://wolfram.com/xid/0btnv30o7q8e-9nur51

Use Background->Transparent to create a collage with transparent background:

https://wolfram.com/xid/0btnv30o7q8e-qdgo8t


https://wolfram.com/xid/0btnv30o7q8e-0g1h2

With Padding->Automatic, images are padded with the background color:

https://wolfram.com/xid/0btnv30o7q8e-jdhm5b

https://wolfram.com/xid/0btnv30o7q8e-9df7l7

Use a different padding value:

https://wolfram.com/xid/0btnv30o7q8e-jvvd4r

Method (5)
By default, the packing method is automatically selected:

https://wolfram.com/xid/0btnv30o7q8e-shlotk

https://wolfram.com/xid/0btnv30o7q8e-szw4m1


https://wolfram.com/xid/0btnv30o7q8e-3roq67

The "ClosestPacking" method tries to find a packing while preserving relative weighted image areas:

https://wolfram.com/xid/0btnv30o7q8e-rjpff0

https://wolfram.com/xid/0btnv30o7q8e-q6xsct

The "Grid" method places the images in a regular grid:

https://wolfram.com/xid/0btnv30o7q8e-vai8w6

https://wolfram.com/xid/0btnv30o7q8e-3ac07q

The "Rows" method places images in horizontal layers:

https://wolfram.com/xid/0btnv30o7q8e-ooh9st

https://wolfram.com/xid/0btnv30o7q8e-8pavd1

Create vertical layers using Method->"Columns":

https://wolfram.com/xid/0btnv30o7q8e-d252v5

With Method->"Grid", by default all cells have the same size, equivalent to ItemSize->All:

https://wolfram.com/xid/0btnv30o7q8e-pfkem1

https://wolfram.com/xid/0btnv30o7q8e-cbrh4x

Use ItemSize->Full to resize each grid cell to its full width and height:

https://wolfram.com/xid/0btnv30o7q8e-67y6bj

ImagePadding (1)
By default, images are not padded:

https://wolfram.com/xid/0btnv30o7q8e-tun5ow

https://wolfram.com/xid/0btnv30o7q8e-mttm3j

Specify the same padding size on all sides:

https://wolfram.com/xid/0btnv30o7q8e-2tbpkb

Specify different padding in the horizontal and vertical directions:

https://wolfram.com/xid/0btnv30o7q8e-uonfhn

Specify different padding for each side:

https://wolfram.com/xid/0btnv30o7q8e-8tpz8m

Padding (1)
By default, with Padding->Automatic, images are padded with the same color as Background:

https://wolfram.com/xid/0btnv30o7q8e-jq3xup

https://wolfram.com/xid/0btnv30o7q8e-cqesqn

Use a different Background:

https://wolfram.com/xid/0btnv30o7q8e-6o3jvm


https://wolfram.com/xid/0btnv30o7q8e-iek1sr

Applications (5)Sample problems that can be solved with this function
Create a collage where images are weighted by their median intensity:

https://wolfram.com/xid/0btnv30o7q8e-zm6n4c

https://wolfram.com/xid/0btnv30o7q8e-vq5k0d

https://wolfram.com/xid/0btnv30o7q8e-ka7ud9

Create a collage of thumbnails of all test images in ExampleData:

https://wolfram.com/xid/0btnv30o7q8e-ehwk1

https://wolfram.com/xid/0btnv30o7q8e-5jzotf

Create a collage of a collection of Picasso's notable paintings:

https://wolfram.com/xid/0btnv30o7q8e-u6xhlz
Get images as well as their corresponding areas for these paintings:

https://wolfram.com/xid/0btnv30o7q8e-0dfrqi
Collage of paintings where each is shown at a size proportional to its original area:

https://wolfram.com/xid/0btnv30o7q8e-x8swom

Collage of images of sample buildings, weighted by their number of floors:

https://wolfram.com/xid/0btnv30o7q8e-v84uel


https://wolfram.com/xid/0btnv30o7q8e-1ypgdm


https://wolfram.com/xid/0btnv30o7q8e-kfkujp

https://wolfram.com/xid/0btnv30o7q8e-5vr0jc

Recognize all barcodes in the collage:

https://wolfram.com/xid/0btnv30o7q8e-u467f3

Properties & Relations (3)Properties of the function, and connections to other functions
ImageCollage works with all kinds of images:

https://wolfram.com/xid/0btnv30o7q8e-0slppt


https://wolfram.com/xid/0btnv30o7q8e-sx6a74

ImageAssemble requires regular images:

https://wolfram.com/xid/0btnv30o7q8e-cq7dq4


Use ConformImages to preprocess the set:

https://wolfram.com/xid/0btnv30o7q8e-sf9wt

Use Grid to visualize images in a regular grid:

https://wolfram.com/xid/0btnv30o7q8e-0a2o40


https://wolfram.com/xid/0btnv30o7q8e-37tgp7

Use WordCloud to assemble words in 2D layout:

https://wolfram.com/xid/0btnv30o7q8e-h4xeuu


https://wolfram.com/xid/0btnv30o7q8e-wz48b1

Possible Issues (1)Common pitfalls and unexpected behavior
If the image set exhibits some regularity, the weights may be altered to create a more packed collage:

https://wolfram.com/xid/0btnv30o7q8e-o5x5n

https://wolfram.com/xid/0btnv30o7q8e-g87rub

Explicitly set all weights to 1 to avoid area differences:

https://wolfram.com/xid/0btnv30o7q8e-0uuw2v

Neat Examples (3)Surprising or curious use cases
Create a country population visualization by showing each country flag, weighted by its population:

https://wolfram.com/xid/0btnv30o7q8e-gey0yl
Select countries that contribute to at least 0.2 percent of the world population:

https://wolfram.com/xid/0btnv30o7q8e-844af6


https://wolfram.com/xid/0btnv30o7q8e-so2cnm

https://wolfram.com/xid/0btnv30o7q8e-3lujm9

Make a collage of 20 disks of random color and size:

https://wolfram.com/xid/0btnv30o7q8e-xzo3wp

Nestedly apply ImageCollage:

https://wolfram.com/xid/0btnv30o7q8e-b7tmx1

Wolfram Research (2014), ImageCollage, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCollage.html (updated 2015).
Text
Wolfram Research (2014), ImageCollage, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCollage.html (updated 2015).
Wolfram Research (2014), ImageCollage, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageCollage.html (updated 2015).
CMS
Wolfram Language. 2014. "ImageCollage." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/ImageCollage.html.
Wolfram Language. 2014. "ImageCollage." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/ImageCollage.html.
APA
Wolfram Language. (2014). ImageCollage. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageCollage.html
Wolfram Language. (2014). ImageCollage. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageCollage.html
BibTeX
@misc{reference.wolfram_2025_imagecollage, author="Wolfram Research", title="{ImageCollage}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/ImageCollage.html}", note=[Accessed: 08-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_imagecollage, organization={Wolfram Research}, title={ImageCollage}, year={2015}, url={https://reference.wolfram.com/language/ref/ImageCollage.html}, note=[Accessed: 08-June-2025
]}