# Create a random image wall

**URL:** https://discourse.processing.org/t/create-a-random-image-wall/11992
**Category:** Project Guidance
**Created:** [June 11, 2019, 5:14pm UTC](https://discourse.processing.org/t/create-a-random-image-wall/11992 "2019-06-11T17:14:01Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![OptOut](https://avatars.discourse-cdn.com/v4/letter/o/cc9497/32.png) [@OptOut](https://discourse.processing.org/u/OptOut)
#### Post date: [June 11, 2019, 5:14pm UTC](https://discourse.processing.org/t/create-a-random-image-wall/11992/1 "2019-06-11T17:14:01Z")

</div>

Hey everybody,

So a bit of a newbie (not totally). I have a project/installation that I am trying to develop and am wondering if it is possible to do it with Processing.

I have a large selection of images (50,000 +, jpegs + pngs, different sizes).

I would like to randomly select a certain amount of them (eg. 10) and then project them . I would like this to iterate every couple of seconds, so that a new image wall of 10 random images appears every couple of seconds.

Is this possible with processing, or am I better trying Maxmsp or something else?

Thanks in advance,

Opt Out

---

<div class="post-metadata">

### Author: ![zenemig](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/zenemig/32/4418_2.png) [@zenemig](https://discourse.processing.org/u/zenemig)
#### Post date: [June 13, 2019, 4:15pm UTC](https://discourse.processing.org/t/create-a-random-image-wall/11992/2 "2019-06-13T16:15:05Z")

</div>

I think Processing can do that, but of course, due to the size of the dataset you will need to be very careful in the loading step, or everything will collapse.

The best thing would be to organize the directory of images in such a way that you can randomize the names of the files and load only the selected ones.

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [June 15, 2019, 3:05pm UTC](https://discourse.processing.org/t/create-a-random-image-wall/11992/3 "2019-06-15T15:05:23Z")

</div>

Should the images be repeating or non-repeating? Do you want to shuffle them like a deck and then deal 10 at a time, or do you want to pull 10 from a bag and then put them back in the bag?

---

<div class="post-metadata">

### Author: ![OptOut](https://avatars.discourse-cdn.com/v4/letter/o/cc9497/32.png) [@OptOut](https://discourse.processing.org/u/OptOut)
#### Post date: [June 15, 2019, 6:03pm UTC](https://discourse.processing.org/t/create-a-random-image-wall/11992/4 "2019-06-15T18:03:36Z")

</div>

Hey Jeremy,

Thanks for taking the time to reply.

The project has moved on a bit since I posted last week. I started another thread\* with more up to date issues here:

> [@Avoid 'clunky' sketch/framerate](https://discourse.processing.org/t/avoid-clunky-sketch-framerate/12041/5):
>
> You should take a look at the [documentation](https://processing.org/reference/HashMap.html) on maps. In this case, I would suggest having the number in your filename as the key, and the actual PImage object as the value. So in draw(), you can simply get the image from the map (using .get(ranNum)) instead of calling loadImage() multiple times. You won’t be stuck with the same random selection as long as you keep the random number generator code in your draw() function. You’re really only changing the loadImage() part. As a side note, since y…

\*Hope that’s ok with mods and I’m not double posting?

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [June 15, 2019, 6:08pm UTC](https://discourse.processing.org/t/create-a-random-image-wall/11992/5 "2019-06-15T18:08:59Z")

</div>

That’s fine!

In general, if the project concept is stable and it has a group of _related_ questions, it is easier to keep adding follow-up questions to a big thread – that way people trying to help you can come up to speed in one place, and aren’t hunting around or re-asking similar questions in multiple threads. So “now that they stop, how do I make them bounce?” – same thread, because we need all the same info on what the class is. Completely disconnected part of the project – motion detection, vs random audio generation – different thread is fine.

---

<div class="post-metadata">

### Author: ![OptOut](https://avatars.discourse-cdn.com/v4/letter/o/cc9497/32.png) [@OptOut](https://discourse.processing.org/u/OptOut)
#### Post date: [June 16, 2019, 12:11pm UTC](https://discourse.processing.org/t/create-a-random-image-wall/11992/6 "2019-06-16T12:11:48Z")

</div>

Thanks for clarifying Jeremy, I’ll be more diligent in the future 😄

---

<div class="post-metadata">

### Author: ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)
#### Post date: [June 16, 2019, 4:25pm UTC](https://discourse.processing.org/t/create-a-random-image-wall/11992/7 "2019-06-16T16:25:57Z")

</div>

No no – you are already doing great, just answering your question.
