Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get random photographs of given sizes
ResourceFunction["RandomPhoto"][n] gives a random square photograph of pixel dimension n⨯n. | |
ResourceFunction["RandomPhoto"][w,h] gives a random photograph of width w and height h. |
ColorSpace | "RGB" | the colorspace of the image; can be either "RGB" or "Grayscale" |
"ImageID" | None | get a specific image from the database by providing an integer |
"ImageType" | "JPEG" | the type of image returned, which can be either JPEG or WEBP |
"Seed" | None | get the same random image everytime based on an integer seed |
Get a random photo containing 200 squared pixels:
In[1]:= | ![]() |
Out[1]= | ![]() |
Get a random photo with arbitrary dimension:
In[2]:= | ![]() |
Out[2]= | ![]() |
Assemble an image out of multiple random photos:
In[3]:= | ![]() |
Out[3]= | ![]() |
Get a random grayscale photograph with pixel dimension 400⨯200:
In[4]:= | ![]() |
Out[4]= | ![]() |
Request a random grayscale photograph:
In[5]:= | ![]() |
Out[7]= | ![]() |
Retrieve the photo at index 472:
In[8]:= | ![]() |
Out[8]= | ![]() |
Specify an integer seed when getting random photos:
In[9]:= | ![]() |
Out[9]= | ![]() |
Observe that a given seed will return the same image:
In[10]:= | ![]() |
Out[10]= | ![]() |
The requested dimensions need to be integers:
In[11]:= | ![]() |
Out[11]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License