Another one line option would be
img = rand(Gray, 4, 3)
which avoids constructing an intermediate array. This is done later in the same tutorial.
Another one line option would be
img = rand(Gray, 4, 3)
which avoids constructing an intermediate array. This is done later in the same tutorial.