I’ve long admired the resource function by Jon McLoone called TessellateGraphics. It fills an area of interest with large and small copies of a masked shape, producing very aesthetically pleasing results. This is an example from its documentation:
In[]:=
ResourceFunction["TessellateGraphics"]
,
,ImageSize->Medium
Out[]=
I found it fun to play with, but never could come up with a way to use the function in my own Wolfram Language projects ... until now. Recently I wanted a way to extract the compositional structure from a piece of 2-dimensional art while hiding or de-emphasizing the subject matter/content. For example, if I had a painting of a man on a horse overlooking a sunset, I wanted a way to show how the artist arranged the bright areas of the sunny sky and the dark areas of the man’s silhouette, the yellow areas of the sun and the blue areas of the shadowed mountains. After a bit of experimentation, here’s what I came up with:
becomes
Now it is easier to see, analyze, and discuss compositional qualities of the painting such as positive and negative space, symmetry, the rule of thirds, etc. The process I used follows five steps:
Add a Frame
It is necessary to surround the image with a black frame inside a white frame, otherwise the TessellateGraphics function might trim dark areas from the output. For instance, in the example above, without the frame the bottom part of the image would get trimmed off:
Separate the image into red, green, and blue components:
In[]:=
chan=ColorSeparate[img]
Out[]=
,
,
Binarize the Channels
This creates the mask for the tessellation:
In[]:=
biCh=Binarize[#,.22]&/@chan
Out[]=
,
,
Tessellate the Channels
Color replacement gives each channel’s tessellation its iconic color, and blur prevents any artifacts from developing around the crisp edges. Each color’s tessellation is different:
Adding the color channels, rather than blending or recombining them, gives the result that I' m after:
In[]:=
ImageResize[ImageAdjust[ImageAdd[tessCh]],Medium]
Out[]=
Conclusion
I manually trim off the white border for my own purposes, and then I’m left with a study of the painting’s composition, both in color and in value. The results have a certain aesthetic appeal of their own. Here are a few famous paintings treated this way: