# \[julia\] imshow() return a dict and no image in Visual Studio Code

**URL:** <https://discourse.julialang.org/t/julia-imshow-return-a-dict-and-no-image-in-visual-studio-code/128953>\
**Category:** General Usage\
**Tags:** vscode\
**Created:** [May 13, 2025, 9:19am UTC](https://discourse.julialang.org/t/julia-imshow-return-a-dict-and-no-image-in-visual-studio-code/128953 "2025-05-13T09:19:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![watchben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/watchben/32/210117_2.png) [@watchben](https://discourse.julialang.org/u/watchben)\
**Post date:** [May 13, 2025, 9:19am UTC](https://discourse.julialang.org/t/julia-imshow-return-a-dict-and-no-image-in-visual-studio-code/128953/1 "2025-05-13T09:19:36Z")

</div>

Hello dear community,

I’m running this code in a jupyter notebook via Visual Studio Code:

```julia
# Packages
using Images, ImageView
# Loading image from path
img_rgb = load(img_path)
# Compound function converting img to gray then to an array of float64
img = Gray.(img_rgb) |> (s -> convert(Array{Float64},s))
# Displaying the result
imshow(img)

```

willing to display the matrix as an image. However, the imshow() function return a Dict in the output cell, and no image:

```julia
Dict{String, Any} with 4 entries:
  "gui" => Dict{String, Any}("window"=>GtkWindowLeaf(Ptr{GObject} @0x00…
  "roi" => Dict{String, Any}("redraw"=>ObserverFunction[ObserverFunctio…
  "annotations" => Observable(Dict{UInt64, Any}())
  "clim" => Observable(CLim{Float64}(0.0980392, 0.960784))

```

Any idea why ? Do I miss a package to correctly display the img ?

Thank you in advance !

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [May 13, 2025, 12:10pm UTC](https://discourse.julialang.org/t/julia-imshow-return-a-dict-and-no-image-in-visual-studio-code/128953/2 "2025-05-13T12:10:01Z")

</div>

> [@watchben](#):
>
> `img = Gray.(img_rgb)`

IIRC, this should display directly in the notebook, without calling `imshow`, and without converting to an array. For example:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/c/acbcbe4a528eef85aedb4dc18627c1dbe9d576a2.png)

`imshow` is supposed to open up a separate window, not show things inside a notebook. (Maybe it is opening a window somewhere you haven’t noticed?)

---

<div class="post-metadata">

**Author:** ![watchben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/watchben/32/210117_2.png) [@watchben](https://discourse.julialang.org/u/watchben)\
**Post date:** [May 13, 2025, 12:48pm UTC](https://discourse.julialang.org/t/julia-imshow-return-a-dict-and-no-image-in-visual-studio-code/128953/3 "2025-05-13T12:48:18Z")

</div>

Indeed, it does display the image, but `Gray.()` output `typeof` is `RGB{N0f8}`. So, I convert to an `Array{Float64}` so I can process FFTs and stuff.  
However, once my image is `Array{Float64}`, the `plot()` function displays each rows as a signal:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/a/7/a7e50514152737566ab0c487f744a06fb00c4e7c.jpeg)  
That’s why I tried to use `imshow()`.

Also, there is indeed a popup window appearing, but it’s blank and makes Julia crashes every time I clic on it:

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [May 13, 2025, 1:07pm UTC](https://discourse.julialang.org/t/julia-imshow-return-a-dict-and-no-image-in-visual-studio-code/128953/4 "2025-05-13T13:07:55Z")

</div>

> [@watchben](#):
>
> However, once my image is `Array{Float64}`, the `plot()` function displays each rows as a signal:

If you want to use Plots.jl, you can use `heatmap(array, c=:grays)`.

> [@watchben](#):
>
> Also, there is indeed a popup window appearing, but it’s blank and makes Julia crashes every time I clic on it:

File an issue with ImageView.jl

---

<div class="post-metadata">

**Author:** ![watchben](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/watchben/32/210117_2.png) [@watchben](https://discourse.julialang.org/u/watchben)\
**Post date:** [May 13, 2025, 1:20pm UTC](https://discourse.julialang.org/t/julia-imshow-return-a-dict-and-no-image-in-visual-studio-code/128953/5 "2025-05-13T13:20:26Z")

</div>

Okay, thank you !
