Matrix Images

Mask a green image with a grid of numbers to give an effect like retro ASCII computer art, or special effects in the Matrix movies.

Use natural language to request a picture of something:

Hint: try a common type of animal, or a famous person.

SHOW/HIDE DETAILS

There are lots of ways to get pictures in the Wolfram Language.

On the desktop, you can take a picture with your computers camera using CurrentImage.

You can use the Wolfram Knowledgebase (the same one that powers Wolfram|Alpha) to ask for a picture of something. Hold down the key and press = to get a natural language input field (LinguisticAssistant):

In[1]:=
X
Out[1]=

You can also drag images from most websites and drop them right into the code. If you want to refer to it later you can always give it a name like image:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Run the code to make the image larger. Try other sizes:

SHOW/HIDE DETAILS

Enlarge the image to 200 pixels wide:

In[1]:=
X
Out[1]=

Reduce the image to 50 pixels wide:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Convert the color image to a monochrome green image. Try converting some other images:

SHOW/HIDE DETAILS

This converts a color photo to a black and white (grayscale) image:

In[1]:=
X
Out[1]=

This converts the grayscale image to green:

In[2]:=
X
Out[2]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Make a grid of digits. Try making grids with different sizes of numbers:

SHOW/HIDE DETAILS

Were going to want to mask the image with a grid of random digits.

Get a random digit between 0 and 9:

In[1]:=
X
Out[1]=

Make a 10×10 array of random digits:

In[2]:=
X
Out[2]=

Format the array as a grid:

In[3]:=
X
Out[3]=

Reduce the grid spacing with Spacings->{0,0} to pack the numbers tightly:

In[4]:=
X
Out[4]=

Reduce the font size to 8 points with FontSize->8:

In[5]:=
X
Out[5]=

Use FontColor->White and Background->Black to make the numbers white and the background black:

In[6]:=
X
Out[6]=

Make the grid larger by increasing its size from 10×10 to 50×40:

In[7]:=
X
Out[7]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Convert the digit grid to an image so you can use it as an image mask:

SHOW/HIDE DETAILS

This gives a grid of digits. The result is text. You can select blocks of text in the grid by dragging in it:

In[1]:=
X
Out[1]=

Convert the digit grid to an image with Rasterize. The result is a picture. You can no longer select blocks of text in the grid by dragging in it, but you can select the whole image by clicking it. The orange frame tells you that its an image:

In[2]:=
X
Out[2]=

If you drag one of the handles on the frame to enlarge the image, you can see the individual pixels:

In[3]:=
X
Out[3]=

HIDE DETAILS
In[1]:=
X
Out[1]=

Apply the digit mask to the green image to make a Matrix-effect image. Try the effect on some other images:

SHOW/HIDE DETAILS

Heres a green image. Give it the name image so you can use it later:

In[1]:=
X
Out[1]=

And heres an image of a digit grid to use as a mask:

In[2]:=
X
Out[2]=

To get the Matrix effect, apply the mask to the green image with ImageMultiply:

In[3]:=
X
Out[3]=

HIDE DETAILS
In[1]:=
X
Out[1]=