Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • Linguistic Understanding

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
RandomImage
  • See Also
    • RandomVariate
    • ImageEffect
    • RandomReal
    • RandomColor
    • ConstantImage
    • LinearGradientImage
    • RadialGradientImage
    • Image
  • Related Guides
    • Creating & Importing Images
    • Random Number Generation
    • See Also
      • RandomVariate
      • ImageEffect
      • RandomReal
      • RandomColor
      • ConstantImage
      • LinearGradientImage
      • RadialGradientImage
      • Image
    • Related Guides
      • Creating & Importing Images
      • Random Number Generation

RandomImage[max]

gives an image with pseudorandom pixel values in the range 0 to max.

RandomImage[{min,max}]

generates pseudorandom pixel values in the range min to max.

RandomImage[dist]

generates pixel values using a symbolic distribution dist.

RandomImage[…,size]

generates a random image of the specified size.

RandomImage[…,size,"type"]

gives an image converted to the specified type.

Details and Options
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Distribution  
Size  
Type  
Options  
ColorSpace  
ImageSize  
Applications  
Properties & Relations  
Possible Issues  
Neat Examples  
See Also
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • RandomVariate
    • ImageEffect
    • RandomReal
    • RandomColor
    • ConstantImage
    • LinearGradientImage
    • RadialGradientImage
    • Image
  • Related Guides
    • Creating & Importing Images
    • Random Number Generation
    • See Also
      • RandomVariate
      • ImageEffect
      • RandomReal
      • RandomColor
      • ConstantImage
      • LinearGradientImage
      • RadialGradientImage
      • Image
    • Related Guides
      • Creating & Importing Images
      • Random Number Generation

RandomImage

RandomImage[max]

gives an image with pseudorandom pixel values in the range 0 to max.

RandomImage[{min,max}]

generates pseudorandom pixel values in the range min to max.

RandomImage[dist]

generates pixel values using a symbolic distribution dist.

RandomImage[…,size]

generates a random image of the specified size.

RandomImage[…,size,"type"]

gives an image converted to the specified type.

Details and Options

  • RandomImage gives an image where pixel values are drawn from a specified distribution. The pixel values are not correlated spatially.
  • Random images can be used for creating synthetic noise images and image effects.
  • RandomImage by default gives an image of a real type.
  • RandomImage[] is equivalent to RandomImage[1,{150,150}].
  • RandomImage[…] is equivalent to RandomImage[…,{150,150}].
  • The size specification can be one of the following:
  • side2D image of size {side,side}
    {width,height}2D image size specification
    {width,depth,height}3D image size specification
  • Possible settings for "type" include:
  • "Bit"integer 0 or 1
    "Byte"integer 0 through 255
    "Bit16"integer 0 through 65535
    "Real32"single-precision real (32 bit)
    "Real64"double-precision real (64 bit)
  • RandomImage accepts all Image and Image3D options with the following additions and modifications:
  • ColorSpace Automaticgenerates an image of the specified color space
    InterleavingNonewhether to generate an interleaved image

Examples

open all close all

Basic Examples  (3)

Generate a random image:

Wolfram Language code: RandomImage[1, {100, 100}]

Generate a random RGB image:

Wolfram Language code: RandomImage[1, {100, 100}, ColorSpace -> "RGB"]

Generate a random 3D image:

Wolfram Language code: RandomImage[1, {50, 40, 20}]

Scope  (8)

Distribution  (5)

By default, pixel values range from 0 to 1:

Wolfram Language code: RandomImage[]

Specify a range of pixel values:

Wolfram Language code: RandomImage[{.5, .8}]
Wolfram Language code: ImageHistogram[%]

Generate an image from pseudorandom values in the range 0 to :

Wolfram Language code: RandomImage[.3]
Wolfram Language code: ImageHistogram[%]

A random image from a normal distribution:

Wolfram Language code: RandomImage[NormalDistribution[.5, .1]]
Wolfram Language code: ImageHistogram[%]

Generate a 4-channel image using some multivariate distribution:

Wolfram Language code: RandomImage[MultinormalDistribution[{0, .1, .2, .3}, .02 * {{1, .2, 0, 0}, {.2, 1, .3, 0}, {0, .3, 1, 0}, {0, 0, 0, 1}}]]
Wolfram Language code: ImageHistogram[%, Appearance -> "Separated"]

Size  (2)

By default, a 2D image is generated:

Wolfram Language code: RandomImage[1]

Specify the image dimensions for a square image:

Wolfram Language code: RandomImage[1, 100]

Specify the image dimensions:

Wolfram Language code: RandomImage[1, {200, 100}]

Specify the 3D image dimensions:

Wolfram Language code: RandomImage[1, {40, 30, 20}]

Type  (1)

By default a real image is created:

Wolfram Language code: RandomImage[1, 10]//ImageType

Create a byte image:

Wolfram Language code: RandomImage[1, 10, "Byte"]//ImageType

Options  (5)

ColorSpace  (4)

By default, no explicit color space is assumed:

Wolfram Language code: RandomImage[1]
Wolfram Language code: ImageColorSpace[%]

Generate a "Grayscale" image:

Wolfram Language code: RandomImage[1, ColorSpace -> "Grayscale"]
Wolfram Language code: ImageColorSpace[%]

Generate a random "RGB" image:

Wolfram Language code: RandomImage[1, ColorSpace -> "RGB"]

Generate an "HSB" image using some univariate distribution:

Wolfram Language code: RandomImage[UniformDistribution[{.2, .6}], ColorSpace -> "HSB"]

Generate a "LAB" image using a multivariate uniform distribution with specific bounds:

Wolfram Language code: RandomImage[UniformDistribution[{{0, 1}, {-1, 1}, {-1, 1}}], ColorSpace -> "LAB"]

ImageSize  (1)

By default, the image is created with ImageSize->Automatic:

Wolfram Language code: RandomImage[1, {50, 50}]

Specify the display size:

Wolfram Language code: RandomImage[1, {50, 50}, ImageSize -> 100]

Applications  (4)

Additive noise:

Wolfram Language code: i = [image]; ImageAdd[i, RandomImage[{-.1, .1}, ImageDimensions[i]]]

Multiplicative noise:

Wolfram Language code: i = [image]; ImageMultiply[i, RandomImage[{0.8, 1.2}, ImageDimensions[i]]]

Image of Laplacian noise:

Wolfram Language code: RandomImage[LaplaceDistribution[0, .2], {100, 100}]

RGB image simulating salt-and-pepper noise using a heavy-tail distribution:

Wolfram Language code: RandomImage[CauchyDistribution[0, .2], {100, 100}, ColorSpace -> "RGB"]

Properties & Relations  (7)

Generate an image with constant intensity:

Wolfram Language code: RandomImage[EmpiricalDistribution[{.7}], {100, 100}]

Use the specialized function ConstantImage instead:

Wolfram Language code: ConstantImage[.7, {100, 100}]

Generate the random data using RandomReal:

Wolfram Language code: Image[RandomReal[1, {100, 100}]]

Generate a random binary image using RandomInteger:

Wolfram Language code: Image[RandomInteger[1, {100, 100}]]

Generate the random data using RandomVariate:

Wolfram Language code: Image[RandomVariate[NormalDistribution[.5, .1], {100, 100}]]

In a uniformly random image, neighboring pixels are not correlated:

Wolfram Language code: image = RandomImage[1]
Wolfram Language code: ImageHistogram[image]
Wolfram Language code: ImageCooccurrence[image, 32]//MatrixPlot

After local filtering, pixel values drawn from the original distribution are spatially correlated:

Wolfram Language code: imgcorr = HistogramTransform[GaussianFilter[image, 3], image]
Wolfram Language code: ImageCooccurrence[imgcorr, 32]//MatrixPlot

Create an image with pixels randomly chosen from a list of colors:

Wolfram Language code: Image[RandomChoice[{Red, Green, Blue}, {10, 10}]]

Create an image from colors randomly chosen from a convex hull defined by a list of colors:

Wolfram Language code: Image[RandomPoint[ConvexHullMesh[List@@@{Red, Green, Blue, Orange}], {10, 10}]]

Possible Issues  (1)

Out-of-range pixel values are rendered as black or white:

Wolfram Language code: RandomImage[{-10, 10}, {100, 100}]

Use ImageAdjust to see the full range of values:

Wolfram Language code: ImageAdjust[%]

Neat Examples  (1)

Show the effect of various types of noise: original image, Poisson noise, uniform noise, Gaussian noise, Laplacian noise, salt-and-pepper noise:

Wolfram Language code: img = [image] ; dims = ImageDimensions@img; l = Flatten@ImagePartition[img, {First@dims / 6, Last@dims}]; ImageAssemble[ImagePad[#, {{1, 1}, {0, 0}}]& /@ Flatten[{First@l, ImageEffect[l[[2]], {"PoissonNoise", .5}], MapThread[ImageAdd[#1, RandomImage[#2, ImageDimensions@#1]]&, {l[[3 ;; ]], {UniformDistribution[{-.2, .2}], NormalDistribution[0, .1], LaplaceDistribution[0, .05], CauchyDistribution[0, .02]}}]}]]

See Also

RandomVariate  ImageEffect  RandomReal  RandomColor  ConstantImage  LinearGradientImage  RadialGradientImage  Image

Function Repository: GetUnsplashImage

Related Guides

    ▪
  • Creating & Importing Images
  • ▪
  • Random Number Generation

History

Introduced in 2010 (8.0) | Updated in 2012 (9.0) ▪ 2014 (10.0) ▪ 2017 (11.1) ▪ 2020 (12.2)

Wolfram Research (2010), RandomImage, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomImage.html (updated 2020).

Text

Wolfram Research (2010), RandomImage, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomImage.html (updated 2020).

CMS

Wolfram Language. 2010. "RandomImage." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/RandomImage.html.

APA

Wolfram Language. (2010). RandomImage. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RandomImage.html

BibTeX

@misc{reference.wolfram_2026_randomimage, author="Wolfram Research", title="{RandomImage}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/RandomImage.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_randomimage, organization={Wolfram Research}, title={RandomImage}, year={2020}, url={https://reference.wolfram.com/language/ref/RandomImage.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English