ConformImages
ConformImages[{image1,image2,…}]
returns a list of images where all imagei are made to have conforming properties, including dimensions, data type, color space, and interleaving.
ConformImages[{image1,image2,…},spec]
returns all images of the specified spec.
ConformImages[{image1,image2,…},spec,fitting]
resizes images using the specified fitting method.
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 allScope (6)
Image Size (1)
Image Properties (3)
Options (6)
Boxed (1)
ColorFunction (2)
By default, ColorFunction is set to Automatic:
Specify the output color function:
ColorFunction is set to Automatic if the input and output color spaces do not match:
ColorSpace (1)
Properties & Relations (1)
Possible Issues (1)
For images with ColorSpace->Automatic, pixel values with fewer channels are zero padded:
Specify the output ColorSpace:
Text
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.
APA
Wolfram Language. (2014). ConformImages. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ConformImages.html