Reputation: 14551
I am trying to figure out the dimensions of an image along with its type in a script so I can pre-set the length and width of my plot window. How can I do that using Julia?
Upvotes: 2
Views: 662
Reputation: 42234
In Julia images are simply arrays. Just use size(img)
full code below:
using Images
#requires using Pkg;pkg"add ImageMagikck"
img = load("photo.jpg")
Now get the size:
julia> typeof(img)
Array{RGB{Normed{UInt8,8}},2}
julia> size(img)
(2222, 2396)
If you want to display the image:
using ImageView
imshow(img)
Upvotes: 4