Create a “visual noise matrix” in Mathematica

In order to avoid "retinal persistence" after the presentation of a stimuli, I need to create a visual noise mask.

This for a screen that has a dimension, in pixel of : 1280 * 960

I believe I could randomly (uniform) assign gray shade to pixels but my attempts yet failed.

Thank you for your attention.


Did you try looking in the help docs? One of the first examples for Image should have done it.

Image@RandomReal[1, {960, 1280}]

You can specify a different range of values:

Image@RandomReal[{0.4, 1}, {400, 600}]

Just noticed:

RandomImage[1, {1280, 960}]

New in Mathematica 8, apparently...

Damn, at last a question on Stack Overflow I could have answered and I was too late... :)

Oh well, here's an alternative solution...

ImageEffect[Image[Table[{0.5, 0.5, 0.5}, {i, 1, 960}, {j, 1, 1280}] ], "GaussianNoise"]

Probably got too many colours in it?

ImageEffect also works on greyscale images.

ImageEffect[Image[Table[0.5, {400}, {600}]], "GaussianNoise"]

Others have already shown you ways of creating a random image. In case you were designing your application to use up the full screen (or based on the current screen's dimensions), you might find it convenient to not hard code the values, but to capture the screen size programmatically. Here's an example showing how:

screenSize = Last /@ ("FullScreenArea" /. 
   Flatten@SystemInformation["Devices", "ScreenInformation"]);
RandomImage[1, screenSize]

Need Your Help

switch two view controller's view in a cube animation

iphone ios animation

the code below implement the switch between two view in a cube animation .

Android Code compilation


I need to use the browser available in the android device emulator. So i was thinking that is there any way that all other application ( like contact etc ) are removed ans only the browser is avail...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.