ConformImages
✖
ConformImages
returns a list of images where all imagei are made to have conforming properties, including dimensions, data type, color space, and interleaving.
Details and Options



- ConformImages is typically used as a preprocessing step to algorithms that need images that are uniform in some way, such as classification, dimensionality reduction, and assembling into bigger images.
- ConformImages works with a list of 2D as well as 3D images.
- Image specification spec can be one of the following:
-
image take the conforming properties from image size image dimensions specification imagetype image type as in ImageType {spec1,spec2,…} specification for multiple properties - By default, the smallest imagetype that can represent the data stored in all imagei is used.
- The following size specifications can be used:
-
w width w, using a height to give the median aspect ratio {w,h} width and height of the output image {w,d,h} width, depth, and height of a 3D image - Any of the w, d, and h can be one of the following:
-
val scalar value f function f to be applied to a list of sizes in each dimension - ConformImages[{image1,image2,…}] resizes all images to have the median width and a height to give the median aspect ratio.
- 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 "Pad" pad and/or crop without resampling "Stretch" stretch the image to fit by resampling "Letterbox" fit the width; pad and/or crop in other dimensions "Pillarbox" fit the height; pad and/or crop in other dimensions "Windowbox" fit to the center; pad all sides - The default fitting method is "Stretch".
- ConformImages has the same options as Image and Image3D with the following additions and changes:
-
ColorSpace Automatic output color space ImageSize Automatic the default displayed size of the image Interleaving Automatic whether to interleave channels Magnification Automatic how to magnify the displayed image Padding Automatic method used to make same-size images - By default, all other option settings are inherited from individual input images, which would be equivalent to option->Inherited.
- With ColorSpace->Automatic, a color space in which all images can be represented is chosen.
- With Interleaving->Automatic, interleaving is set to False only if no input image is interleaved.
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (6)Survey of the scope of standard use cases
Image Size (1)
Conform image sizes using automatic sizing:

https://wolfram.com/xid/0dqugdjm7vo-62ga6i

https://wolfram.com/xid/0dqugdjm7vo-xawv2r


https://wolfram.com/xid/0dqugdjm7vo-yykcdg

Conform each image to have the maximum width and automatic height:

https://wolfram.com/xid/0dqugdjm7vo-k0vkd9

Use smallest width and height:

https://wolfram.com/xid/0dqugdjm7vo-nstoi8

Use smallest width and largest height:

https://wolfram.com/xid/0dqugdjm7vo-elptiw

Image Properties (3)

https://wolfram.com/xid/0dqugdjm7vo-j71kl6

https://wolfram.com/xid/0dqugdjm7vo-3wo6e8

Specify both size and data type:

https://wolfram.com/xid/0dqugdjm7vo-to8e9y

https://wolfram.com/xid/0dqugdjm7vo-5lee59

Use an image to specify conforming properties:

https://wolfram.com/xid/0dqugdjm7vo-0n1jut

https://wolfram.com/xid/0dqugdjm7vo-hv8tjp

Fitting Methods (2)
By default, images are stretched to fit in the common size:

https://wolfram.com/xid/0dqugdjm7vo-b6w5tj

https://wolfram.com/xid/0dqugdjm7vo-ikdv6z

Specify a different fitting method:

https://wolfram.com/xid/0dqugdjm7vo-u7ibn4

Conform properties of a list of 3D images:

https://wolfram.com/xid/0dqugdjm7vo-9jx12f

https://wolfram.com/xid/0dqugdjm7vo-cefw5z

Options (6)Common values & functionality for each option
Boxed (1)
ColorFunction (2)
By default, ColorFunction is set to Automatic:

https://wolfram.com/xid/0dqugdjm7vo-q6mjev

https://wolfram.com/xid/0dqugdjm7vo-ih06zh


https://wolfram.com/xid/0dqugdjm7vo-gqfn9w

Specify the output color function:

https://wolfram.com/xid/0dqugdjm7vo-26n9x9

ColorFunction is set to Automatic if the input and output color spaces do not match:

https://wolfram.com/xid/0dqugdjm7vo-tcrsto

https://wolfram.com/xid/0dqugdjm7vo-3uh3qx


https://wolfram.com/xid/0dqugdjm7vo-0n8txb


https://wolfram.com/xid/0dqugdjm7vo-7dfldm

ColorSpace (1)
By default, a color space that can store the most image information is selected:

https://wolfram.com/xid/0dqugdjm7vo-cawuc6

https://wolfram.com/xid/0dqugdjm7vo-bqwakg


https://wolfram.com/xid/0dqugdjm7vo-ffvjhs


https://wolfram.com/xid/0dqugdjm7vo-x8uvlv

Specify the output color space:

https://wolfram.com/xid/0dqugdjm7vo-klbozp


https://wolfram.com/xid/0dqugdjm7vo-x7ibpv

Padding (2)
Default padding value is chosen based on the fitting method:

https://wolfram.com/xid/0dqugdjm7vo-coc6vl
With "Pad" fitting method, a common border color is used when available. Otherwise black is used:

https://wolfram.com/xid/0dqugdjm7vo-nowagz


https://wolfram.com/xid/0dqugdjm7vo-4y1uuh

Black padding is used with "Letterbox", "Pillarbox", and "Windowbox" fitting methods:

https://wolfram.com/xid/0dqugdjm7vo-ychwvx

https://wolfram.com/xid/0dqugdjm7vo-2wobo

Applications (2)Sample problems that can be solved with this function
Properties & Relations (1)Properties of the function, and connections to other functions
For multichannel images with a different number of channels, the maximum number of channels is used:

https://wolfram.com/xid/0dqugdjm7vo-oi9f3w


https://wolfram.com/xid/0dqugdjm7vo-igoq0f


https://wolfram.com/xid/0dqugdjm7vo-f6st1b

Zero is used for non-existing channels:

https://wolfram.com/xid/0dqugdjm7vo-rgewrv

Possible Issues (1)Common pitfalls and unexpected behavior
For images with ColorSpace->Automatic, pixel values with fewer channels are zero padded:

https://wolfram.com/xid/0dqugdjm7vo-cya5ho


https://wolfram.com/xid/0dqugdjm7vo-62jfi2

Specify the output ColorSpace:

https://wolfram.com/xid/0dqugdjm7vo-bnwlso

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