RadialGradientImage[gcol]
returns an image with values radially changing from center to corners based on gradient color gcol.
RadialGradientImage[{pos1,pos2}gcol]
returns an image where the gradient starts at pos1 and ends at pos2.
RadialGradientImage[…,size]
returns a radial gradient image of the specified size.
RadialGradientImage[…,size,"type"]
gives an image converted to the specified type.
RadialGradientImage
RadialGradientImage[gcol]
returns an image with values radially changing from center to corners based on gradient color gcol.
RadialGradientImage[{pos1,pos2}gcol]
returns an image where the gradient starts at pos1 and ends at pos2.
RadialGradientImage[…,size]
returns a radial gradient image of the specified size.
RadialGradientImage[…,size,"type"]
gives an image converted to the specified type.
Details and Options
- RadialGradientImage constructs and returns a 2D or 3D image with constant radial gradient, with a center and radius specified with the input positions.
- Color scheme specification gcol can be any of the following:
-
{col1,col2,…} blend of multiple color directives coli "name" ColorData["name"] f function f that returns a color based on a scalar distance - The argument passed to the function f is by default the normalized distance between a pixel and pos1.
- Position specification posi can be any of the following:
-
{x,y} or {x,y,z} absolute pixel position Left,Right
axis in 2D and 3DBottom,Top
axis in 2D,
axis in 3DFront,Back
axis in 3DCenter center alignment {posx,…} a list of named positions - Positions that are not constrained are taken to be centered.
- By default, positions are assumed to be in the standard image coordinate system.
- The size specification can be one of the following:
-
side 2D image of size {side,side} {width,height} 2D image size specification {width,depth,height} 3D image size specification - The default size is {150,150} for 2D images and {64,64,64} for 3D images.
- RadialGradientImage[] is equivalent to RadialGradientImage[{Black,White}].
- LinearGradientImage accepts all Image and Image3D options with the following additions and changes:
-
ColorFunction Automatic how each pixel should be colored ColorFunctionScaling True whether to scale the argument to ColorFunction DataRange Full range of coordinates in the original image Padding "Fixed" padding scheme - Possible 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,w},{0,d},{0,h}} in 3D (default) {{left,right},{bottom,top}} explicit coordinate ranges in 2D {{left,right},{front,back},{bottom,top}} explicit coordinate ranges in 3D
Examples
open all close allBasic Examples (3)
Create a grayscale radial gradient image:
RadialGradientImage[]Radial blend of colors from center to corners:
RadialGradientImage[{Blue, Yellow, Red}]Radial gradient image centered at the bottom-left corner:
RadialGradientImage[{{Left, Bottom}, {Right, Top}} -> {Blue, Yellow, Red}]Scope (14)
Color Scheme (6)
RadialGradientImage[{Red, Yellow}]Radial blend of multiple colors:
RadialGradientImage[{Red, Blue, Green, Yellow}]Repeat a color to get a thicker band for that color:
RadialGradientImage[{Red, Blue, Blue, Green, Yellow}]RadialGradientImage[ColorData["Rainbow"]]Use hue as the coloring function:
RadialGradientImage[Hue]Specify a custom color function:
RadialGradientImage[RGBColor[#, 1 - #, # / 2]&]Position (6)
By default, a radial gradient image from center to corners is generated:
RadialGradientImage["Rainbow"]Left-center to right-center radial gradient:
RadialGradientImage[Left -> Hue]A corner to center gradient image:
RadialGradientImage[{{Left, Bottom}, Center} -> ColorData["Rainbow"]]A corner to corner gradient image:
RadialGradientImage[{{Left, Bottom}, {Right, Top}} -> ColorData["Rainbow"]]If position along one dimension is not given, center alignment is used for that dimension:
RadialGradientImage[{Left, Top} -> ColorData["Rainbow"]]3D radial gradient from center-front to back corners:
RadialGradientImage[Front -> ColorData["Rainbow"], {15, 15, 15}]Size (2)
By default, a 2D image of size
is generated:
RadialGradientImage[Hue]RadialGradientImage[Hue, {50, 50}]If absolute pixel positions are given, an image with minimum dimensions containing positions is returned:
RadialGradientImage[{{0, 0}, {100, 100}} -> Hue]Specify a different output size:
RadialGradientImage[{{0, 0}, {100, 100}} -> Hue, {150, 150}]By default, a 3D image of size
is generated:
RadialGradientImage[{Front, {Right, Back, Top}} -> ColorData["Rainbow"]]RadialGradientImage[{Front, {Right, Back, Top}} -> ColorData["Rainbow"], {40, 30, 20}]Options (1)
ColorFunction (1)
With no color specification, GrayLevel is the default color function:
RadialGradientImage[{Center, {100, 100}}, {100, 100}]Specify a different color function:
RadialGradientImage[{Center, {100, 100}}, {100, 100}, ColorFunction -> Hue]Use a built-in color gradient:
RadialGradientImage[{Center, {100, 100}}, {100, 100}, ColorFunction -> ColorData["Rainbow"]]Use Blend to specify a color function that is a blend of multiple colors:
RadialGradientImage[{Center, {100, 100}}, {100, 100}, ColorFunction -> (Blend[{Blue, Yellow, Green}, #]&)]Applications (2)
i = [image];g = ImageResize[RadialGradientImage[{Center, {0, 0}}, {100, 100}, ColorFunction -> (Blend[{{0, White}, {.7, White}, {1, Black}}, #]&)], ImageDimensions[i]]ImageMultiply[i, g]Colorize components of an image with rainbow colors going from center to corners:
i = [image];g = RadialGradientImage[ColorData["Rainbow"], ImageDimensions[i], DataRange -> {{0, 1}, {0, 1}}, ColorFunction -> ColorData["Rainbow"]]centroids = ComponentMeasurements[i, "Centroid"];colors = ImageValue[g, centroids[[All, 2]]];Colorize[MorphologicalComponents[i], ColorRules -> MapThread[#[[1]] -> #2&, {centroids, colors}]]Related Guides
Text
Wolfram Research (2014), RadialGradientImage, Wolfram Language function, https://reference.wolfram.com/language/ref/RadialGradientImage.html (updated 2020).
CMS
Wolfram Language. 2014. "RadialGradientImage." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/RadialGradientImage.html.
APA
Wolfram Language. (2014). RadialGradientImage. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RadialGradientImage.html
BibTeX
@misc{reference.wolfram_2026_radialgradientimage, author="Wolfram Research", title="{RadialGradientImage}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/RadialGradientImage.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_radialgradientimage, organization={Wolfram Research}, title={RadialGradientImage}, year={2020}, url={https://reference.wolfram.com/language/ref/RadialGradientImage.html}, note=[Accessed: 13-June-2026]}