Select random images

Started by sinus, April 28, 2022, 08:25:13 PM

Previous topic - Next topic

sinus

Hi
For some presentations it would be cool, if we could simply select some images randomly.

Means, I have e.g. 1000 images on screen.
Now I want select, say 50 images, but randomly.

Kind of a game, of course, but quite nice for some things.
Is this possible?
Best wishes from Switzerland! :-)
Markus

Mario

IMatch has no built-in feature to randomly select images. I don't see a use for that in common workflows.

This would be something a small app could do easily, though.
The Math.random function in JavaScript delivers a random number between 0 and 1.
Call it 50 times and multiple it by the number of files in the File Window.
Select the files by the result of that calculation.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on April 28, 2022, 08:29:31 PM
IMatch has no built-in feature to randomly select images. I don't see a use for that in common workflows.

This would be something a small app could do easily, though.
The Math.random function in JavaScript delivers a random number between 0 and 1.
Call it 50 times and multiple it by the number of files in the File Window.
Select the files by the result of that calculation.

Thanks, Mario

If I have time (and still can do it  8)) I will try to do so.
It is not important, more just fun (eine Spielerei), but quite interesting for me.
Best wishes from Switzerland! :-)
Markus

sinus

@JohnZeman

Hi John
Last night  8) I remembered that you once had a solution to select 100 or 200 or so forward (and maybe also backwards).

But I am 1) not sure, if you are the one, if not, sorry
And if, do you have still a script or thoughts, how you did this?

Maybe this could help me to realize my "random-project".
Best wishes from Switzerland! :-)
Markus

Jingo

Let me know if you need any assistance Markus - I'd be happy to whip something up...!

Mario

The IMatch Slide Show supports a randomized display sequence for images.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Jingo on April 29, 2022, 12:57:12 PM
Let me know if you need any assistance Markus - I'd be happy to whip something up...!

Hi Andy
Thanks for your nice words.

although with IMatch you have many possibilities to sort, search or find pictures, it is sometimes interesting to look at random photos.

You can (re)discover pictures you haven't remembered for a long time. And then you can look at them, drink a fine coffee (ok, a glass of wine works too  ;D) and think about the photos.
Pictures that you wouldn't have looked at for a long time otherwise. We could even create a kind of game "can you remember this picture and guess the date?".

I imagined that I could simply choose somewhere how many photos should be randomly collected.
That could be 4-5 buttons with different values such as
20
50
100
200 photos

Or you could enter a desired number or whatever.

Searching for random pictures in the whole database would not be ideal in my case, because I also have different formats (xls, indd, docs, blend ...).
Therefore, I think it would make sense to search for random images from a category.
Or simply from a selection.


Personally, Jingo, I have the problem that to create an app, for example, I am helpless without a template.  ::)
Once I have a template that has something similar, then I am able to modify it.
For example, I slightly adapted your cool search-app for me, and I still use your app today (because it's super cool and simple, I love it really).

For example, if you had a script that took 5-10 images from a random selection and put them into a result window, I think I might be able to modify the script to pick 5 random images.
And then I would further try that you could choose how many photos should be displayed randomly in a result window.

I thought of John because I remembered that he had a script that selected the next 100 pictures forward, so I might be able to change that, but I don't remember that very well. It was a long time ago.

So, Andy, if you have an idea or a script where you think I could change something, that would be great.
But as Mario already wrote, many users will probably not be interested, except for people like me with a certain "gaming gene".

I hope, you understand, what I mean. But bear in mind, maybe this is only interesting for a couple of users.
Although I would guess, if such a possibility would exist (hit a knob and get 20 random images (only image) out of your database), there would a lot of users hit on this knob.  8)



Best wishes from Switzerland! :-)
Markus

sinus

Quote from: Mario on April 29, 2022, 01:40:22 PM
The IMatch Slide Show supports a randomized display sequence for images.

Thanks, Mario ... I did not know this. I will check it.

But to be honest, I seldom use the slideshow, because I like to create some pdfs, what I can send to peoples and use it with a handy and so on.
That is my background here ... finde e.g. 20 images randomly, create a pdf, copy it on my mobile handy and  in the evening look at them and remember.   :D
Quite nice before sleeping ...
Best wishes from Switzerland! :-)
Markus

Jingo

Quote from: sinus on April 29, 2022, 01:45:16 PM

So, Andy, if you have an idea or a script where you think I could change something, that would be great.
But as Mario already wrote, many users will probably not be interested, except for people like me with a certain "gaming gene".

No worries.. I realize that most folks will never use the apps I create - and this is fine.. for me, coding is a relaxing activity and one I enjoy so being able to create and share something is a win-win for me.. even if it never gets used by anyone!

sinus

Quote from: Jingo on April 29, 2022, 11:53:46 PM
Quote from: sinus on April 29, 2022, 01:45:16 PM

So, Andy, if you have an idea or a script where you think I could change something, that would be great.
But as Mario already wrote, many users will probably not be interested, except for people like me with a certain "gaming gene".

No worries.. I realize that most folks will never use the apps I create - and this is fine.. for me, coding is a relaxing activity and one I enjoy so being able to create and share something is a win-win for me.. even if it never gets used by anyone!

WOW  ;D relaxing for me is a fine cup of coffee ... hmm, but your relaxing is much more productive and at the end you have a (again relaxing) result!  ;D :) Cool.
Best wishes from Switzerland! :-)
Markus

sinus

If you do not know, where to search ... just look at IMatch community.  ;D

I still looking for a variable or search-term (regex?) to find some images in IMatch.

A variable with a random function would be of course very cool, because I could use it everywhere, even in Design & Print.

That is why I found an not so old thread from Darius1968 https://www.photools.com/community/index.php?topic=11460.msg81876#msg81876

And Mario gave there a very good hint for a "trick" to get random numbers.
I forgot this hint, but now I will check and thest this out.
Best wishes from Switzerland! :-)
Markus

Mario

#11
This is really easy to do with the powerful APIs IMatch provides.
For example, this does all the work. Add it to one of your scripts, call it at the press of a button, change the number of files to select and you're done.
See attachment.

I doubt that a variable which randomly selects a file (not sure how this could work) would be useful for many users. Feel free to add a FR, as usual.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Thanks, Mario, this is really very kind of you.  :)
I am sure, you have a 28-hour - day ... I wonder, when you do sleep.  8)

I will sure try this ... but ... just now I am photographing a picture with bread, egg, butter, jam, honey and cheese, everything is set up ... and the graphic designers are arguing ... er, sorry, discussing how to properly spread butter and jam on a piece of bread.  :o ::)

And that's why you run out of time, when I would rather would like to work on your lines about the "random problem".
Best wishes from Switzerland! :-)
Markus

Mario

I did some food shootings with fuming ADs and nervous food stylists myself a while ago  ::) ;)
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

sinus

Quote from: Mario on May 19, 2022, 03:33:38 PM
I did some food shootings with fuming ADs and nervous food stylists myself a while ago  ::) ;)

;D  :)
Best wishes from Switzerland! :-)
Markus