Pointilify-ing your images

Gopi Krishna Nuti
2 min readOct 7, 2020

--

Have you guys heard about Pointilism? It is a distinct variety of paintings where the image is created not by using long brush strokes but by short “dots” and “dashes”. It is an impressive form of painting, if it appeals to you. Take a look at the below photograph (Image courtesy Wikipedia). It is a fantastic example of pointilism.

https://upload.wikimedia.org/wikipedia/commons/e/e0/Paul_Signac_Femmes_au_puits_1892d%C3%A9tailcouleur.jpg

As a child when I first learnt about it, I wanted to make paintings like these myself. Humanity was fortunate and I did not become an artist. But I did learn computer vision and image processing. And I wrote a program which pointilifies an image. I want to share the code and details here.

Algorithm

  1. Read the input image as grayscale (not colour)
  2. Reduce the image to 1/8th of its original size
  3. Create an empty image with the same size as original
  4. Identify the distribution of pixel values and calculate the quartiles i.e. q1, q2, q3 and a4.
  5. Now walk through the reduced image by each pixel.
  6. If the pixel intensity is less than q1 then consider it as a whitespace. Assign 8by8 pixel space in the empty image with a pure white image. If the intensity is between q1 and q2 then assign the 8x8 pixel space in the empty image with a “.”. If the intensity is between q2 and q3 then use a “+”. If it is greater than q4 then use a pure black 8x8 image.
  7. Save the new file to disk.

You can see the code here. https://github.com/ngopikrishna/ComputerVision/tree/main/pointilify

This produces the below results.

Here’s another of George Clooney

What do you guys think? You might want to try with other images as well. Photographs of real people give good results. The higher the resolution, the better. Photographs of paintings are less likely to give a good result because of low variation of pixel intensities. Feel free to checkout the code from Github and play with it.

Thanks,
Gopi Krishna Nuti

--

--