Loading image files not working in Pluto notebook

The following works fine in Julian mode.

julia> using Images

julia> readdir()
2-element Array{String,1}:
 "Untitled.png"
 "getimages.jl"

julia> img = load("Untitled.png")
280×382 Array{RGB{N0f8},2} with eltype RGB{Normed{UInt8,8}}:
 RGB{N0f8}(0.0,0.498,0.38)     …  RGB{N0f8}(0.0,0.333,0.271)  RGB{N0f8}(0.0,0.333,0.271)
 RGB{N0f8}(0.0,0.498,0.38)        RGB{N0f8}(0.0,0.333,0.271)  RGB{N0f8}(0.0,0.333,0.271)
 RGB{N0f8}(0.0,0.494,0.38)        RGB{N0f8}(0.0,0.333,0.271)  RGB{N0f8}(0.0,0.333,0.271)
 RGB{N0f8}(0.0,0.482,0.373)       RGB{N0f8}(0.0,0.333,0.271)  RGB{N0f8}(0.0,0.333,0.271)
 RGB{N0f8}(0.0,0.459,0.353)       RGB{N0f8}(0.0,0.337,0.275)  RGB{N0f8}(0.0,0.337,0.275)
 RGB{N0f8}(0.0,0.435,0.333)    …  RGB{N0f8}(0.0,0.337,0.275)  RGB{N0f8}(0.0,0.337,0.275)
 RGB{N0f8}(0.0,0.412,0.31)        RGB{N0f8}(0.0,0.337,0.275)  RGB{N0f8}(0.0,0.337,0.275)
 RGB{N0f8}(0.0,0.4,0.306)         RGB{N0f8}(0.0,0.337,0.275)  RGB{N0f8}(0.0,0.337,0.275)
 RGB{N0f8}(0.0,0.388,0.298)       RGB{N0f8}(0.0,0.341,0.278)  RGB{N0f8}(0.0,0.341,0.278)
 RGB{N0f8}(0.004,0.376,0.294)     RGB{N0f8}(0.0,0.341,0.278)  RGB{N0f8}(0.0,0.341,0.278)
 RGB{N0f8}(0.0,0.361,0.275)    …  RGB{N0f8}(0.0,0.341,0.278)  RGB{N0f8}(0.0,0.341,0.278)
 RGB{N0f8}(0.0,0.345,0.259)       RGB{N0f8}(0.0,0.341,0.278)  RGB{N0f8}(0.0,0.341,0.278)
 RGB{N0f8}(0.0,0.345,0.267)       RGB{N0f8}(0.0,0.349,0.286)  RGB{N0f8}(0.0,0.349,0.286)
 ⋮                             ⋱  ⋮
 RGB{N0f8}(1.0,0.996,1.0)         RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,0.996,1.0)         RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,0.996,1.0)      …  RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,0.996,1.0)         RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,1.0,1.0)           RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,1.0,1.0)           RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,1.0,1.0)           RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,1.0,1.0)        …  RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,1.0,1.0)           RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,1.0,1.0)           RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,1.0,1.0)           RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)
 RGB{N0f8}(1.0,1.0,1.0)           RGB{N0f8}(1.0,1.0,1.0)      RGB{N0f8}(1.0,1.0,1.0)

However the same code does not work in a Pluto notebook.

Please advise.

This might be fixed by adding the ImageMagick package:
https://github.com/JuliaIO/ImageIO.jl/issues/6#issuecomment-676196199

1 Like

Thank you!

I take it this is an example of package dependency where individually, Images and Pluto don’t individually depend on ImageMagick, but when used together they do, and Julia has no (current) way of taking note of this at package installation time.

No this is unrelated to Pluto, the same issue exists in other IDEs. Images is normally able to output to PNG without ImageMagick, but because of an ongoing bug it is not. So now it depends on ImageMagick to work, but does not have ImageMagick listed as required dependency

1 Like