Truchet Tiles

Published: Sat 21 May 2022
By Alex

In art.

Truchet Tiles

Sebastien Truchet figured out how square tiles can be combined to form larger patterns. In the picture below you see tiles of different types to use as input for generating mosaics.

In [1]:
from IPython.display import Image
Image(r'C:\thisAKcode.github.io\images\truchet1.png', width = 200)
Out[1]:

Linear optimisation for mosaicing grayscale images

To make mosaics from a grayscale picture you need to group its pixels into k x k blocks and associate it with a tile. The blocks identified as ordered coordinate pairs (i,j). So the upper left block is (0,0) it's followed by (0,1), (0,2), …across the row. Block (i, j) is the block in row i and column j. For k=3 you have 9 pixels in a block- we compute the average of its 9 pixels' grayscale values and then divide the average by 255. This gives us a block brightness value \beta i, j that falls somewhere in the closed interval [0, 1]. As before, 0 corresponds to black, but now 1 corresponds to white. For block (32, 34), the block in the upper-left corner of the part of the image that corresponds to Truchet's left eye, the average grayscale value is 154.11, so $ \beta_i,_j $ 32,34 = 154.11∕255 = 0.60. For block (36, 39), in the opposite corner, the average grayscale value is 241.67, so $ \beta_i,_j $ 36,39 = 241.67∕255 = 0.95. In other words, block (32, 34) is somewhat brighter

links

social