# How to load a collection of image files with Images.jl or ImageView.jl

**URL:** <https://discourse.julialang.org/t/how-to-load-a-collection-of-image-files-with-images-jl-or-imageview-jl/30829>\
**Category:** General Usage\
**Tags:** plotting\
**Created:** [November 7, 2019, 2:33pm UTC](https://discourse.julialang.org/t/how-to-load-a-collection-of-image-files-with-images-jl-or-imageview-jl/30829 "2019-11-07T14:33:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [November 7, 2019, 2:33pm UTC](https://discourse.julialang.org/t/how-to-load-a-collection-of-image-files-with-images-jl-or-imageview-jl/30829/1 "2019-11-07T14:33:04Z")

</div>

I have generated (in //) a collection of image files : toto1.gif, toto2.gif,…,toto100.gif  
How can I load and visualize them with ImageView.jl ?

Laurent

---

<div class="post-metadata">

**Author:** ![pixel27](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pixel27/32/8902_2.png) [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Post date:** [November 7, 2019, 2:40pm UTC](https://discourse.julialang.org/t/how-to-load-a-collection-of-image-files-with-images-jl-or-imageview-jl/30829/2 "2019-11-07T14:40:26Z")

</div>

Have you looked here?

[https://github.com/JuliaImages/ImageView.jl](https://github.com/JuliaImages/ImageView.jl)

---

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [November 7, 2019, 2:46pm UTC](https://discourse.julialang.org/t/how-to-load-a-collection-of-image-files-with-images-jl-or-imageview-jl/30829/3 "2019-11-07T14:46:15Z")

</div>

Actually I did, but I do not find any example starting from a collection of input files…  
Should I take a second look ?

---

<div class="post-metadata">

**Author:** ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Post date:** [November 7, 2019, 3:06pm UTC](https://discourse.julialang.org/t/how-to-load-a-collection-of-image-files-with-images-jl-or-imageview-jl/30829/4 "2019-11-07T15:06:58Z")

</div>

Depending on what you want to achieve, wouldn’t [this](https://github.com/JuliaImages/ImageView.jl#simple-command-line-utilities) or [this](https://github.com/JuliaImages/ImageView.jl#coupling-two-or-more-images-together) be good starting points?

---

<div class="post-metadata">

**Author:** ![LaurentPlagne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laurentplagne/32/10103_2.png) [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Post date:** [November 7, 2019, 7:35pm UTC](https://discourse.julialang.org/t/how-to-load-a-collection-of-image-files-with-images-jl-or-imageview-jl/30829/5 "2019-11-07T19:35:48Z")

</div>

OK, I was not able to find any direct answer to my question in the previous link so I use a loop for reading the different image files and construct the 3D Array :

```julia
using Images,ImageView

function readimages(nimages)
    img=load("toto1.png")
    nx,ny=size(img)
    @show nx,ny,nimages
    images=zeros(RGB{Normed{UInt8,8}},nx,ny,nimages)
    for i=1:nimages
        img=load("toto$i.png")
        images[:,:,i].=img[:,:]
    end
    images
end

images=readimages(nδt)
imshow(images)

```

imshow allows to play the animation or to use the slider: nice 🙂
