ImageForwardTransformation[image,f]
gives an image in which each pixel at position f[{x,y}] corresponds to the position {x,y} in image.
ImageForwardTransformation[image,f,size]
gives an image of the specified size.
ImageForwardTransformation[video,…]
transforms frames of a video.
ImageForwardTransformation
ImageForwardTransformation[image,f]
gives an image in which each pixel at position f[{x,y}] corresponds to the position {x,y} in image.
ImageForwardTransformation[image,f,size]
gives an image of the specified size.
ImageForwardTransformation[video,…]
transforms frames of a video.
Details and Options
- ImageForwardTransformation[image, f], also known as forward transformation, transforms every pixel at position {x,y} in image to position f[{x,y}] in the output image.
- ImageForwardTransformation[image,f] gives an image of the same size as the original.
- ImageForwardTransformation works with arbitrary 2D images.
- The pixel positions in the original image are assumed to run from 0 to 1 in the horizontal direction and from 0 to the aspect ratio in the vertical direction.
- Possible settings for size are:
-
Automatic automatic image size All same as input image size width explicit width, automatic height {width,height} explicit width and height {width,depth,height} explicit width, depth and height in 3D - For possible width, depth and height specifications, see the reference page for ImageResize.
- For possible size specifications, see the reference page for ImageResize.
- ImageForwardTransformation can take the following options:
-
Background Black background value DataRange Automatic assumed range of
and
values in the original imageMethod Automatic interpolation method to use PlotRange Automatic range of coordinates to be included in the result of the transformation - Typical settings for DataRange include:
-
Automatic {{0,1},{0,h/w}} in 2D, {{0,1},{0,d/w},{0,h/w}} in 3D Full {{0,w},{0,h}} in 2D, {{0,1},{0,d},{0,h}} in 3D {{left,right},{bottom,top}} explicit coordinate ranges in 2D {{left,right},{front,back},{bottom,top}} explicit coordinate ranges in 3D - The coordinate system of the resulting image is specified by the PlotRange option. Typical settings include:
-
Automatic same as DataRange settings All try to include all of the transformed pixels Full same ranges as the input image {{left,right},…} explicit coordinate ranges - When PlotRange is not Automatic, size is chosen based on the size of the original image and the ratio of PlotRange and DataRange.
- By default, transformed points are interpolated using Method->"Interpolated". Use MethodNone to avoid interpolation.
Examples
open all close allBasic Examples (1)
Scope (8)
Data (3)
ImageForwardTransformation[[image], # ^ 2&]ImageForwardTransformation[[image], # ^ 2&]ImageForwardTransformation[\!\(\*VideoBox[""]\), # ^ 2&]Transformation (4)
Use any function for the transformation:
i = [image];ImageForwardTransformation[i, Cos[Pi / 2 #]&]ImageForwardTransformation[i, ArcSin[ # ^ 4]&]ImageTransformation[i, FractionalPart[3# Total[#]] ^ 1.5&]ImageForwardTransformation[i, # Total[#]&]Operate explicitly on
and
pixel positions:
i = [image];ImageForwardTransformation[i, {#[[1]] ^ 2, #[[2]] #[[1]]}&]Operate on the vertical dimension only:
ImageForwardTransformation[i, {#[[1]], 1 - Sqrt[#[[2]]]}&]Perform a matrix transformation:
ImageForwardTransformation[[image], {{(1/2), (1/4)}, {1, -(1/2)}}.#&]Use a geometric transform function:
ImageForwardTransformation[[image], ReflectionTransform[{1, -1}]]Rotate image around its center using rotation transform:
ImageForwardTransformation[[image], RotationTransform[35°, {0.5, 0.5}]]Size (1)
By default, the output image is of the same size as the input image:
i = [image];ImageForwardTransformation[i, # ^ 2&]ImageDimensions[i] == ImageDimensions[%]Specify the size of the resulting image:
ImageForwardTransformation[i, # ^ 2&, 100]Specify width and height explicitly:
ImageForwardTransformation[i, # ^ 2&, {200, 100}]ImageForwardTransformation[i, # ^ 2&, Scaled[0.5]]ImageForwardTransformation[i, # ^ 2&, Tiny]Use All to obtain an image of the same size as the original:
ImageForwardTransformation[[image], RotationTransform[45°, {0.5, 0.5}], #, PlotRange -> (| | |
| ------------------- | ------------------ |
| (1/2) (1 - Sqrt[2]) | (1/2)(1 + Sqrt[2]) |
| (1/2) (1 - Sqrt[2]) | (1/2)(1 + Sqrt[2]) |)]& /@ {All, Automatic}Options (4)
Background (1)
By default, a black background is used:
i = [image];
ImageForwardTransformation[i, RotationTransform[-20]]Use a specific color for the background:
ImageForwardTransformation[i, RotationTransform[-20], Background -> Red]ImageForwardTransformation[i, RotationTransform[-20Degree], Background -> Transparent]DataRange (1)
By default, DataRange->Automatic is used:
i = [image];ImageForwardTransformation[i, TranslationTransform[{-0.2, -0.2}], DataRange -> Automatic]Use DataRange->Full when defining translation in pixel coordinates:
ImageForwardTransformation[i, TranslationTransform[{50, 50}], DataRange -> Full]Specify a custom DataRange:
ImageForwardTransformation[i, TranslationTransform[{-0.2, -0.2}], DataRange -> {{0, 1}, {0, 0.5}}]Choose a data range symmetric on the
axis to show a vertical reflection:
ImageForwardTransformation[i, ReflectionTransform[{0, 1}], DataRange -> #]& /@ {Automatic, {Automatic, {-.5, .5}}}Adjust the plot range to include all image pixels:
ImageForwardTransformation[i, # + 50&, DataRange -> Full,
PlotRange -> Transpose@{{0, 0}, ImageDimensions@i + 50}]Method (1)
PlotRange (1)
By default, the output image retains the plot range of the input image:
i = [image];
ImageForwardTransformation[i, RotationTransform[-45°]]Use PlotRange->All to view all transformed image pixels:
ImageForwardTransformation[i, RotationTransform[-45°], PlotRange -> All]Use explicit plot range values:
ImageForwardTransformation[i, RotationTransform[-45°], PlotRange -> {{0, Sqrt[2]}, {-(1/Sqrt[2]), Sqrt[2] - (1/Sqrt[2])}}]Use pixel coordinates with PlotRangeFull option:
ImageForwardTransformation[i, RotationTransform[35°, ImageDimensions[i] / 2], PlotRange -> Full]Applications (3)
Reverse an unknown geometric transformation by determining the transformation function from a pair of images:
i = [image];j = [image];
tf = FindGeometricTransform[i, j, TransformationClass -> "Rigid"][[2]]Apply the transformation to the transformed image:
ImageForwardTransformation[j, tf, DataRange -> Full]ImageForwardTransformation[[image], 8.3Floor[# / 8] + 1&, DataRange -> All]ImageForwardTransformation[[image], # + .1Floor[10#]&, 200,
PlotRange -> All]Properties & Relations (3)
ImageForwardTransformation[[image], 1.5#&]ImageTransformation does the opposite:
ImageTransformation[[image], 1.5#&]Reversing pixel coordinates is an operation that gives the same result for forward and reverse transforms:
ImageForwardTransformation[[image], Reverse]ImageTransformation[[image], Reverse]Doing a transformation with a function and its inverse gives back the original image with some blurring due to interpolation:
ImageForwardTransformation[ImageForwardTransformation[[image], Sqrt], # ^ 2&]Neat Examples (3)
i = [image];
f[x_, y_, c_] := With[{r = N@Sqrt[(x - c[[1]]) ^ 2 + (y - c[[2]]) ^ 2], a = ArcTan[x - c[[1]], y - c[[2]]], R = Min[c]}, rn = Sqrt[r * R];
{rn * Cos[a] + c[[1]], rn * Sin[a] + c[[2]]}]
ImageForwardTransformation[i, f[#[[1]], #[[2]], ImageDimensions[i] / 2]&, DataRange -> Full, Background -> None]ImageForwardTransformation[[image], {#[[1]], #[[2]] - RandomReal[] * 30}&, PlotRange -> Full]img = [image];
f[x_, y_, c_] := With[{r = N@Sqrt[(x - c[[1]]) ^ 2 + (y - c[[2]]) ^ 2], a = ArcTan[x - c[[1]], y - c[[2]]] / Pi * 180},
{x + Mod[(a + r / 2.), 16] - 8, y}];
ImageForwardTransformation[img, f[#[[1]], #[[2]], ImageDimensions[img] / 2.]&, DataRange -> Full]Related Guides
Text
Wolfram Research (2010), ImageForwardTransformation, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageForwardTransformation.html (updated 2021).
CMS
Wolfram Language. 2010. "ImageForwardTransformation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/ImageForwardTransformation.html.
APA
Wolfram Language. (2010). ImageForwardTransformation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageForwardTransformation.html
BibTeX
@misc{reference.wolfram_2026_imageforwardtransformation, author="Wolfram Research", title="{ImageForwardTransformation}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/ImageForwardTransformation.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_imageforwardtransformation, organization={Wolfram Research}, title={ImageForwardTransformation}, year={2021}, url={https://reference.wolfram.com/language/ref/ImageForwardTransformation.html}, note=[Accessed: 15-June-2026]}