Loading image using julia

help me plz

Please provide an mwe, as text - not an image. I don’t know what packages you’re using and what you expect to happen.

1 Like

@gustaphe I want to load image using julia with command

name=load("C:/Users/TOSHIBA/.julia/packages/FileIO/u9YLx/src/19decembre88.JPG");
imshow(name)

didn’t work

error:

1 Like

That’s not the error I get – I get ERROR: UndefVarError: load not defined, presumably because both load and imshow come from some package. MWE is too minimal and not enough working.

@gustaphe how can i see picture?

Based off the file path, I assume you’re on Windows? There’s a builtin image viewer iirc. Just double click the file in the explorer.

If you want to load the image in Julia, there’s an Images package.

@gustaphe Yes windows

imshow does not display Julia images
you need to create a particular Python array

see

https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.imshow.html?highlight=imshow#matplotlib.pyplot.imshow

I’ve spent about an hour trying

Best I could manage was greyscale

using Images, PyPlot

img = load("milano.jpg")

i = 1
px = Vector{Float64}(undef, size(img,1)*size(img,2))
for y in 1:size(ps,2)
    for x in 1:size(ps,1)
        px[i] = Float64(img[x,y].r) + Float64(img[x,y].g) +  Float64(img[x,y].b)
        i += 1
    end
end
px ./ 3;
imshow(reshape(px, size(img,1), size(img,2)); cmap="gray")

1 Like

Or

using GMT

img = gmtread("http://www.quickmill.it/wp-content/uploads/2020/03/0980G-Milano.jpg");
imshow(img, frame=:none)

1 Like

This is probably the most basic way:

using Images, ImageView
img = load("shakespeare.jpeg");
imshow(img)

5 Likes

you wait 18 days for a reply, and then 3 show up at once

1 Like