Mosaify Image Filter
Mosaify is an image filter written in ↬ Python 2.7 utilizing the ↬ Python Imaging Library. It takes in an input image and outputs a mosaified version of it. (↬ Sourcecode via pastebin)
Starting with a blank canvas the size of the original image, lines are randomly drawn, which will most likely intersect to form polygons of different sizes and shapes. Said polygons are filled with the original image’s color at each polygon’s most top-left pixel position.
As a final touch, the lines drawn at the beginning are filled in with one pseudo-randomly chosen surrounding pixel. Because of this, edges are a bit frazzled.
Other appearances can be achieved by changing parameters n and k, which define the number of lines drawn and their distribution (both floating-point numbers larger than zero, by default n = 5 and k = 1). It may also help to run the filter a few times to get a visually pleasing output, as the polygons are pseudo-randomly determined.
The program usage is as follows: python mosaify.py <image file name> [n] [k]
![Martin and ivy, mosaified with n=5 and k=1 (which are the default parameters) Martin and ivy, mosaified with n=5 and k=1 (which are the default parameters)](https://dpfs.medienfrech.de/6a975d57796f5232d763c3753b00ed4fe7d4273406aa251b981f08322c4de6a6.jpeg)
![Martin and ivy, mosaified with n=10 and k=1 Martin and ivy, mosaified with n=10 and k=1](https://dpfs.medienfrech.de/84973c9969c069213341617b88faf5ffa70117b9c58bf14f3049502cc55531dc.jpeg)
![Martin and ivy, before processing Martin and ivy, before processing](https://dpfs.medienfrech.de/2abc0f3dc321bc0f50cc4d6fd31947bc44269cc729c04b1a43f87ab92134d04f.jpeg)