ReliefImage[array]
generates a relief image of an array of height values.
ReliefImage
ReliefImage[array]
generates a relief image of an array of height values.
Details and Options
- ReliefImage always gives an 8-bit RGB image.
- ReliefImage can take the following options:
-
ClippingStyle {Black,White} how to draw clipped parts of the surface ColorFunction Automatic how to determine the color of surfaces ColorFunctionScaling True whether to scale arguments to ColorFunction ImageSize Automatic the default displayed size LightingAngle Automatic effective angle of the simulated light source Method Automatic the method to use PlotRange All the range of height values to include - In ReliefImage[array], array must be a rectangular array, with each element a single real number representing a
value. - Possible settings for Method include "DiffuseReflection" and "AspectBasedShading".
- ReliefImage also works with arbitrary images.
Examples
open all close allBasic Examples (3)
Use elevation data to display shaded terrain:
ReliefImage[Reverse@Import["http://exampledata.wolfram.com/hailey.dem.gz", "Data"]]Relief shading of an image to enhance details:
ReliefImage[[image]]Display density data with shading:
ReliefImage[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .03}, {j, -4, 4, .03}], ColorFunction -> "SunsetColors"]Scope (1)
ReliefImage[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None]ReliefImage[Table[i + Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> "StarryNightColors"]Options (17)
ClippingStyle (3)
Clipped regions are not shown by default:
ReliefImage[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .03}, {j, -3, 3, .03}], PlotRange -> Automatic]Use pink to fill the clipped regions:
ReliefImage[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .03}, {j, -3, 3, .03}], ClippingStyle -> Pink, PlotRange -> Automatic]Use gray where the surface is clipped at the top and purple where it is clipped at the bottom:
ReliefImage[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .03}, {j, -3, 3, .03}], ClippingStyle -> {Purple, Gray}, PlotRange -> Automatic]ColorFunction (5)
ReliefImage[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None]ReliefImage[Table[y + Sin[x ^ 2 + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], ColorFunction -> Hue]Specify gray-level intensity by scaled
coordinate:
ReliefImage[Table[x + Sin[3x + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], ColorFunction -> GrayLevel]Named color gradients color in the
direction:
ReliefImage[Table[x + Sin[3x + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], ColorFunction -> "SunsetColors"]Use brightness to correspond to the height or density of a function:
ReliefImage[Table[x + Sin[3x + y ^ 2], {x, -4, 4, 0.05}, {y, -4, 4, 0.05}], ColorFunction -> (Hue[2 / 5, 3 / 4, #]&)]LightingAngle (4)
By default, the simulated lighting is placed at
, or the top-left corner, with altitude
:
ReliefImage[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None]Place the light source at 180°, or the left side:
ReliefImage[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], LightingAngle -> 180°, ColorFunction -> None]Place the light source at 0°, or the right side of the map, with
altitude:
ReliefImage[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], ColorFunction -> None, LightingAngle -> {0, Pi / 12}]ReliefImage[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], LightingAngle -> None]Method (2)
Normally, the "DiffuseReflection" method is used for shading:
ReliefImage[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], Method -> "DiffuseReflection", ColorFunction -> None]Use the "AspectBasedShading" method:
ReliefImage[Table[Sin[i ^ 2 + j ^ 2], {i, -4, 4, .05}, {j, -4, 4, .05}], Method -> "AspectBasedShading", ColorFunction -> None]PlotRange (3)
Normally, ReliefImage uses all points to compute the range:
ReliefImage[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> All]Automatically compute the
range and clip extreme portions of it:
ReliefImage[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> Automatic]Specify the
range to emphasize features:
ReliefImage[Table[Im[Sec[(i + I j) ^ 2]], {i, -3, 3, .02}, {j, -3, 3, .02}], PlotRange -> {-.1, .5}]Possible Issues (1)
Define two consecutive datasets:
data1 = Table[Sin[10i j]Exp[-j], {i, -1, 1, .01}, {j, 0, 1, .005}];
data2 = Table[Sin[10i j]Exp[-j], {i, -1, 1, .01}, {j, 1, 2, .005}];Due to
-value scaling, two results may not be consistent:
Row[{ReliefImage[data1], ReliefImage[data2]}]By specifying the same plot range, two results become consistent with each other:
Row[{ReliefImage[data1, PlotRange -> {-1, 1}], ReliefImage[data2, PlotRange -> {-1, 1}]}]Neat Examples (2)
A sum of quotients of norms seen in relief:
Table[ReliefImage[Table[Evaluate[Sum[Product[Norm[{x, y} - RandomReal[{-3, 3}, {2}]], {i, j}] / Product[Norm[{x, y} - RandomReal[{-3, 3}, {2}]], {i, j}], {j, 1, 10}]], {x, -5, 5, .05}, {y, -5, 5, .05}], PlotRange -> Automatic, ColorFunction -> "Rainbow", ClippingStyle -> Darker[Red]], {3}]Sample a sum of five sine waves in random directions:
Table[ReliefImage[Table[Evaluate[Sum[Sin[RandomReal[4, 2].{x, y}], {5}]], {x, 0, 10, .05}, {y, 0, 10, .05}], ColorFunction -> "DarkRainbow"], {3}]See Also
Related Guides
History
Text
Wolfram Research (2010), ReliefImage, Wolfram Language function, https://reference.wolfram.com/language/ref/ReliefImage.html.
CMS
Wolfram Language. 2010. "ReliefImage." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ReliefImage.html.
APA
Wolfram Language. (2010). ReliefImage. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ReliefImage.html
BibTeX
@misc{reference.wolfram_2026_reliefimage, author="Wolfram Research", title="{ReliefImage}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/ReliefImage.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_reliefimage, organization={Wolfram Research}, title={ReliefImage}, year={2010}, url={https://reference.wolfram.com/language/ref/ReliefImage.html}, note=[Accessed: 13-June-2026]}