Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Create a square-symmetric image from a long string of text
ResourceFunction["TextToKaleidoscope"][str] converts the string str into a square image with rotational and reflectional symmetries. | |
ResourceFunction["TextToKaleidoscope"][str,level] converts the string str into a square image of dimensions 2level×2level. |
Create an image from a modern English version of Beowulf:
In[1]:= | ![]() |
Out[2]= | ![]() |
Here are the prebuilt color schemes, as applied to Alice in Wonderland:
In[3]:= | ![]() |
Out[5]= | ![]() |
A similar but more detailed set of images is shown at pixelation level 9:
In[6]:= | ![]() |
Out[6]= | ![]() |
Here is an unsymmetrized image computed from Beowulf:
In[7]:= | ![]() |
Out[7]= | ![]() |
TextToKaleidoscope will automatically create a random color scheme if so desired:
In[8]:= | ![]() |
Out[8]= | ![]() |
TextToKaleidoscope does not change the internal state of the random generators, so repeating the above results in the same image:
In[9]:= | ![]() |
Out[9]= | ![]() |
Explicitly change the internal random state to get a new randomized color scheme:
In[10]:= | ![]() |
Out[11]= | ![]() |
By default, TextToKaleidoscope will produce very dark images if given a short text:
In[12]:= | ![]() |
Out[12]= | ![]() |
Using a lower pixelation value for short text can produce brighter images:
In[13]:= | ![]() |
Out[13]= | ![]() |
Images can be lightened explicitly using Lighter:
In[14]:= | ![]() |
Out[14]= | ![]() |
Wolfram Language 11.3 (March 2018) or above
This work is licensed under a Creative Commons Attribution 4.0 International License