Image not showing in IJulia

When I run the example code from the Images Documentation img = Array(reshape(range(0,stop=1,length=10^4), 100, 100)) in a Julia (Jupyter) notebook, I only see the raw output (below), not the image itself. This issue must have such a simple fix, but I can’t seem to find it.

Output from the above:

100×100 Matrix{Float64}:
 0.0         0.010001   0.020002   0.030003   …  0.970097  0.980098  0.990099
 0.00010001  0.010101   0.020102   0.030103      0.970197  0.980198  0.990199
 0.00020002  0.010201   0.020202   0.030203      0.970297  0.980298  0.990299
*extra lines removed*

Potentially helpful information:

julia> using Pkg, Dates

julia> today()
2021-04-01

julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-1035G4 CPU @ 1.10GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, icelake-client)

julia> Pkg.status()
      Status `C:\Users\Jon\.julia\environments\v1.6\Project.toml`
  [5789e2e9] FileIO v1.6.5
  [7073ff75] IJulia v1.23.2
  [82e4d734] ImageIO v0.5.3
  [6218d12a] ImageMagick v1.2.0
  [916415d5] Images v0.23.3
  [5e47fb64] TestImages v1.4.0

You are right. The image would be constructed by converting the array to a Matrix of Colorant values. The step provided:

julia> img = rand(4, 3)
4×3 Array{Float64,2}:
 0.294863  0.603624   0.113032
 0.696311  0.0443766  0.670174
 0.332355  0.915681   0.140473
 0.415085  0.372323   0.0813266

should have the additional line

julia> Gray.(image)

to produce the image output.
I suspect the documentation hasn’t been updated (this is something that is probably quite old). Maybe make a documentation PR?

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.