Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Generate a mosaic version of an image
ResourceFunction["ImageMosaic"][img,samples] reconstructs img as a mosaic art representation using sample images samples. |
| "BlendingFraction" | .3 | use fraction from 0 to 1 to blend the result with img |
| "ProcessingFunction" | Automatic | preprocessing applied to the image |
| RasterSize | Automatic | resize img before processing |
| "TileSize" | 12 | resize samples before reconstruction |
Create a mosaic version of an image using a random set of colored pixels:
| In[1]:= | ![]() |
| Out[1]= | ![]() |
Load an image dataset:
| In[2]:= | ![]() |
Use the dataset to reconstruct a mosaic version of an image:
| In[3]:= | ![]() |
| Out[3]= | ![]() |
Load an image dataset:
| In[4]:= | ![]() |
Use custom blending when reconstructing a mosaic image:
| In[5]:= | ![]() |
| Out[5]= | ![]() |
Load an image dataset:
| In[6]:= |
By default no image processing operations are performed to preprocess the input image:
| In[7]:= | ![]() |
| Out[7]= | ![]() |
Use of a custom preprocessing function affects the output quality:
| In[8]:= | ![]() |
| Out[8]= | ![]() |
By default, the input image dimensions are preserved (though the resulting size may not be exactly the same, as discussed in "Possible Issues" below):
| In[9]:= | ![]() |
| Out[9]= |
| In[10]:= | ![]() |
| Out[10]= |
Resize the image:
| In[11]:= | ![]() |
| Out[11]= |
Load an image dataset:
| In[12]:= | ![]() |
Use the dataset to reconstruct the mosaic version of an image:
| In[13]:= | ![]() |
| Out[13]= | ![]() |
Specifying a custom tile size may result in a more faithful rendition of the input image:
| In[14]:= | ![]() |
| Out[14]= | ![]() |
The output image size might not exactly match the input image size:
| In[15]:= | ![]() |
| Out[15]= |
| In[16]:= |
| Out[16]= |
Search for images online:
| In[17]:= |
Select a random sample:
| In[18]:= |
| Out[18]= | ![]() |
Try to reconstruct the selected image using the full set of the images:
| In[19]:= |
| Out[19]= | ![]() |
Add more images to the dataset in order to cover a bigger color range:
| In[20]:= |
| In[21]:= |
| Out[21]= |
Create a mosaic version with no blending:
| In[22]:= |
| Out[22]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License